Question: How to Limit Canon Rotation

I am having trouble limiting the rotation of my canon for the space shooter portion of the super wu man game. Basically, you’re in the cockpit, and the canon is out in front of you, so kind of looking down the barrel. I have the arrow keys set for d rot, but I want the cannon not to rotate past a certain boundary, so you won’t be able to point the gun backwards, see? I thought this would be easy, but I haven’t come up with a set up that works yet. If someone could describe to me a set up that will work, or point me in the right direction, I would sure appreciate it.

I dont have much time tonight… hope i can do this in a few words…

basicaly you make an IPO of the cannons rotation, and have an IPO actuator set to property…

Have your right key Add one to the property, and your left key minus from the property

have 2 property sensors… one at 0 and the other end of your IPO to do this: (lets say 50 is your highest IPO frame)
If the property = 0 then assign property to 1
for the limmit
If the property =51 then assign property to 49

I will be back in the morning… if you still need help please just ask, and i will try to make a .blend file for you.

thanks man, I will see what I can do with that. I noticed you made a crane with a similar type of movement on one of the recent CVS. ( btw, is anyone else having whacky trajectory problems with add object? )

I’ve seen the trajectory problem before, but I’ve not been able to track down the source of the problem. Anyway, p00f’s answer for the cannon thing is the same answer I would give you, so you can be sure it’s the right answer.:wink:

hey moderon…

Umm for adding objects…
go to your layer 2… select the object you want to ad to the scene, and press ALT-r to clear the rotation… then control A to apply size and rotation.

if it is still bothering you goto your Objects menu, and click on the show axis button. this will show you exactly where it is pointing…

If you still have problems with it, please post a .Blend file

Yep, that was it. Still working on the ipo thing, but my trajectory is now on target. Thanks man.