Rotation in direction of movement help...

So I'm making a simple bug smash game and I want my actor(s) to spawn then move in a random direction..Now that was easy enough...My problem is having it facing the direction its moving...I did try what was posted here before but that didn't work...It kept spinning out of control or didn't rotate at all...Here is what I used.

Comments

  • jeezzcakejeezzcake Member Posts: 144

    Set "Relative to: scene" in the Move Behaviour, then use a Timer to change the rotation:
    Timer:
    After 0.01 sec
    self.Rotation = vectorToAngle (vel.x,vel.y)

  • Speedy007Speedy007 Member Posts: 229

    It stopped
    him from spinning all over the place but it still is off...Doesn't rotate right...

  • jeezzcakejeezzcake Member Posts: 144

    Use the Change Attribute behaviour not the Constrain Attribute.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    The bug graphic is off by 90 degrees. Redo the graphics and make the bug's head face directly to the right ---->

    Facing right is the 0 degree position.

  • Speedy007Speedy007 Member Posts: 229

    ahhhh....lol...thanks...will try that....

  • Speedy007Speedy007 Member Posts: 229

    And it works like a charm...Thanks ya'll

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    You are welcome!

Sign In or Register to comment.