Your side motion means that the character does steps to the side.
With left/right you need to rotate the control cube and not move. The forward motion should be relative to the character (local).
Your camera is not parented to the control cube. You could
- parent the camera to the control cube
- set slow parent (F7) + TimeOffset (e.g. 30) to the camera for smooth following
- remove all actuators from the camera
- remove the trackTo actuator from the control cube
- change the control cube’s motion actuators from the Left/Right motion to left/right rotation.
By the way it would make sense to name your sensors, actuators and objects. Without that you might loose the overview of the scene.
I hope it helps
That is not the type of control I wanted him to have. I don’t want to have a FPS control on a TPS view… I want a TPS control. Almost every modern game use this controls… you just have to press the key where you want to go (relative to camera) and the character automaticaly walk in that direction… humpfff… sorry if it sound weird, I realy have trouble explaining myself… I’m french.
Aligning an object to the direction its moving it actually really, really easy: Velocity is a vector, meaning it has size and direction:
[LEFT]# Aligning an object to the direction its moving:object = …velocity = object.getLinearVelocity()object.alignAxisToVect(velocity, 1, 1) # Align Y axis to the velocityobject.alignAxisToVect([0,0,1], 2, 1) # Align Z axis to point directly up (stops flipping bugs)[/LEFT]
Note, this will only work if you are using velocity rather than Dloc movement.
This is exactly what I wanted and I use velocity :D… but how would I use this script in my game ??? (the logic boxes configuration, I mean)