1
$\begingroup$

In my game, I have this logic: logic editor

(The top actuator is the mouse looking thing, and the two hidden actuators are the same as Motion and Motion.001, just with different axis).

When I'm facing forwards, it's fine - it moves at a uniform speed constantly, but when I face downwards, it stops moving all together, and if I look down slightly, it slows down. I know why this happens: It moves on the local axis so when I'm looking downwards, it tries to move into the floor but can't.

Is there a way (preferably without scripting - but if scripting is needed it's fine) to make it even when looking straight downwards to move at a constant speed forwards?

Here is my 3D view, if it helps:

3D view

$\endgroup$
2
$\begingroup$

I think you should separate the logic for movement+rotZ and mouselooking+rotX into two different objects, and then parent the second one to the first one. With such setup, the object moved by keyboard is always facing parallel to the ground, not trying to dig into it. The example of this would be camera and cuboid. The camera is rotated only in X axis (relating to your orientation from screen) with mouse and it's parented to cuboid. The cuboid is rotated in Z axis with mouse and also is moved with keyboard. You can check the blend file below to see how it's done (Blender 2.74 or the latest build). Note the camera from my example can be replaced with your object of choice, and cuboid can be set to invisible so it can't be seen ingame.



I hope this can help solve your problem. If you have additional questions, please consider providing a .blend file for more accurate feedback.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.