180 turn?

I’m trying to make a “survival horror” game to learn the basics of the game engine, and maybe learn a little Python. I’ve made a small room with sensors placed here and there that change the camera angles when something collides with them. I’ve also made a rather low-poly model and animated it. You can move forwards and turn left and right. Instead of moving backwards when pressing down, I want it to make a 180 turn.

This is where I’m stuck. I’ve been trying to look at some basic Python tutorials for this. Can anyone help me out?

Not certain, but I don’t think u need python! Use the dloc actuator (not sure which axis)

Make that the dROT actuator. dLOC handles location change, and dROT handles rotation change. Have it so it rotates 180 degrees, and set the pulse number really high so that it won’t rotate again for a long time unless you press back again.

Using a pulse would just prevent it from firing as you hold the key down. Pressing it repeatedly will ignore pulse rates and have the character spin in circles. If this is a problem, then use a timer property instead.

I can see the problem. But I didn’t really think people would tap down so often for it to be a problem.

Hmmm… there are many ways to do this…

The first one would involve having a Guide object (I think this is the easiest way to work with directions). This guide object will be parented to your main character, and at the same time, the main character will have a “track to” actuator tracking the guide object… This guide object will have an IPO animation, in which in the first frame it will on one side of the object and on the second frame it will be on the other side… SO then you just attach a couple of keyboard sensors for your guide, and when the player presses UP, the IPO will only play frame 1, and when the player presses down, the guide will move to the back of the character…

HMmm…
You can PM me your email address so that I can send you a simple demo file… This method I consider is pretty interesting and easy to work with once it is set up…

ANOTHER curiosity… if you set an object’s dRot to 3.60, it will instantly rotate 180 degrees on that axis…
If you ever want to make INSTANT rotations, you can consider this formula:
dRot = degrees * 2 / 100

THat is, when you want an object to rotate 45º, you should set the dRot to:
45 * 2 / 100 = .9…

In case you (or anyone else) needs it…

Thanks for the replies, I’ll give it a try and let you know if I get it to work.

Hm… the ipo idea is good! Thanks, I never really thought of that!