I'm relatively new to blender but I am wondering if there is a way to press a button to set a rotation for an object in game logic. For example, press up to look forward, left to look left, right to look right, etc. I'm trying to achieve movement like in the Super Mario 3D games as opposed to steering the character to look in a certain direction

  • $\begingroup$ If I understand you correctly, you want to parent your camera to the player, like looking over the shoulder, so you get the perspective but also can see the character. You make the player move and rotate using the logic bricks, and the camera follows you. If this is what you want, there are some great YouTube tutorials, and I just finished a maze game like this and I could send you the file. I'm a beginner too. This is the first question I could answer. $\endgroup$ Sep 2 '17 at 19:23
  • $\begingroup$ You should check out BORNCG's YouTube channel. He has BGE tutorials for this sort of thing. $\endgroup$
    – Mentalist
    Sep 3 '17 at 10:00

A simple solution with action:

You create an action with 4 rotation poses e.g. at frame 1 (North), 2 (West), 3 (South), 4 (East).

Then play the according pose dependent on the key:

enter image description here

Be aware: This does align to the scene. It does not align to the camera!


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.