Problems with turning when flying spaceship.

I am making a flying game where you are flying a spaceship around obstacles, but I have a problem.
I want to make the ship fly up, but the spaceship will just turn 360’, it won’t stop turning.
How do I stop it from turning for ever, and only fly vertically?

(This picture shows my spacecraft upside down due to the infinite turning)

Any help on this issue would be most appreciated. :slight_smile:

Thanks, :slight_smile:

It sound like your not using true, pulse mode,

However it would be easier to take a look at a .blend, (I am off to bed)

But hopefully true pulse was your issue.

Ps rotatational dampining is good.

Do you know python at all yet?

Take a look at the text editor and then open game logic simple,

If own.locallinearVelocity.y>0:

This is for carving

This assumes you using y+ as forward axis.

I think you just want a rotation cap so he can’t point more than vertical?

You’ll need some python for that, and there’s some nasty vector stuff that’ll have to go into that too. Perhaps a simpler way it to use an animation with a controlling property, and then cap the property

Why would a spaceship not be able to fly a loop?

Nevertheless you can cap up/down turning dependent of the current up/down orientation.

Thanks for the replies. :slight_smile:
I have to admit I am very inexperienced with the game engine.
For some reason when I input the code:

and try to run the script, I receive the invalid syntax error message. I am pretty sure I am doing something wrong, but I have no idea what it might be.

I decided to try using an Orientation constraint, but I got some results that I am not very happy with.

Here is a link to the Blend file if that will help. >HERE<

I am very sorry for my ignorance.

check this out


ShipPhysics.blend (431 KB)