how to make something stop at an angle in game logic

I have a helicopter and I’ve got it set up to rotate forward when going forward but I need it to stop once it gets at a certain angle instead of completing a circle like the slight tilt in a helicopter that is going forward

if angle < desired_angle:
angle += some_increment
else:
angle = desired_angle

How you’re gonna get and set the angle depends on what you’re using to rotate, there are millions of different ways to do that.

I used game logic to rotate, also I’m not sure what
if angle < desired_angle:
angle += some_increment
else:
angle = desired_angle
means

Just use properties.
Made this for you:

http://blenderartists.org/forum/showthread.php?t=167763

Hope it’s what you need. :wink:

Its for a script. If you want game logic you can make a property called like rotate or something, then just make the property get added to every time you press the key. all you have to do then is limit the amount that the actuators will add.


Just what i was looking for.