Help with limiting a rotation

hey guys,
i have small … well, not really small … rather big problem.
I don’t know how to limit a rotation … say to 10 degrees, regardless how long a user presses they key assigned to rotate the object.
For example: How could i animate a piano key going down as long as the player presses a key and once the key is released, the key would go back up again?

I have goggled but didn’t find anything that would help me do this.

Any helpful info regarding constraining a rotation would help me a lot,
THANKS :slight_smile:

To limit a rotation, you could simply make an integer property and set up logic like this:

leftarrow (true level trigger)==>and==>drot
AND
property: prop≠number

leftarrow (true level trigger)==>and==>property= prop +1

Basically, whenever you press the left arrow, the property will go up 1 continuously. When the property reaches a certain number, the object can no longer turn. Play around with it until you get what you like.

Thank you,
i’ll give it a try!

btw: C00L nick :slight_smile:

You can also use the new orientation constraint actuator included in 2.47.