Buildbox 3d - Change Character Direction

Discussion in 'How Can I...?' started by terravexo, Nov 10, 2018.

  1. terravexo

    terravexo Boxer

    Joined:
    Sep 21, 2018
    Messages:
    8
    Likes Received:
    0
    Hi all,

    This may be a simple one for someone, or it may even be a bug, but I'm hoping someone can help me.

    I've got a character (similar to the float template) flying along with a fixed X and Z axis. That's great.

    However I decided to get clever and try to have one scene where we change the X axis by 90 degrees (so turning a corner). Unfortunately I'm struggling to get the character to turn 90 degrees on this corner, then continue as it was.

    I've tried a few things with little success:

    - Level path - This could have made the turn, however that doesn't allow the game to "fly" any more as we're stuck on our Y axis (we use touch to move the character up on the Y axis, otherwise Y steadily gets lower).

    - Collision cube - Rotation Animation - I tried creating a collision cube which would then rotate the character 90 degrees, however nothing happens whatsoever. The collision detection is fine, however since I tested by having the character change colour upon collision, which makes me wonder if this is a bug.

    I'm not quite sure where to go next.

    Any ideas, suggestions? I'd certainly appreciate it!

    Thanks,
     
  2. terravexo

    terravexo Boxer

    Joined:
    Sep 21, 2018
    Messages:
    8
    Likes Received:
    0
    Anything, anyone?
     
  3. terravexo

    terravexo Boxer

    Joined:
    Sep 21, 2018
    Messages:
    8
    Likes Received:
    0
    Well, I managed to get this working myself in the end via scripting:

    let rot = this.entity().rotation();
    this.entity().setRotation(270,0,-90);

    I added this to the "move" node whenever my actor hit the collision cube to update the rotation. It may prove useful for someone. Obviously the values will need to be changed, and you may wish to pick up original rotation via:

    rot.x
    rot.y
    rot.z

    Once you've defined rot of course. :)
     

Share This Page