How to limit rotation on a specific axis

Hi
I’m trying to make a windmill wings model rotate on a axis, here’s the model when imported in the editor

I defined an angular velocity (2.0,0.0,0.0), it effectively make the wings rotate on the x axis (the wooden rod of the model)

However, I want to rotate the node on the y axis by 20.0, like this (I’m working on a 2D plateforming game and use 3D models for scenary) and have the wings rotate without the x axis changing so that the wooden rod stay parallel to the ground

But the rotation is making the wooden rod goes up and down :

I joined the scene and the model here
https://ufile.io/1et4m

I’m not sure if I could use a constraint or something

angularFactor?

+20 chars

I tried with an angular factor at (0.0,0.0,1.0) but it doesn’t seem to make a difference

You could try a constraint, but the task looks like misuse of dynamic RigidBody.

Is there a way to do what I’m looking for without using a RigidBody?
I tried using an Attribute Animation on the node but I’ve got the same problem, I’m not very familiar with manipulating models right now, in Blender there’s a ‘Limit Rotation’ constraint to restrict the rotation on certain axis, that’s what I’m looking for

What exactly do you want to reach?
Something like `node.Rotate(Quaternion(timeStep*ang, 0, 0))` somewhere in Update will make you model rotate around X axis.

1 Like

I would like to change the model’s angle, and apply a rotation while maintaining the ‘rod’ (the wooden part) parallel to the world’s x axis, it’s not that easy to explain…

here’s the scene and the model

I think there’s a constraint for this but I must be doing something wrong

Like @Eugene said… doesn’t this do exactly that?

2 Likes

Sorry my bad, I made a mistake when I tried it, works like a charm!

Thanks guys

1 Like