playMaker

Author Topic: Pointing to the direction of movement, not facing.  (Read 1100 times)

CuriousRodeo

  • Playmaker Newbie
  • *
  • Posts: 11
Pointing to the direction of movement, not facing.
« on: April 03, 2018, 11:34:46 AM »
 Hi,

I'm making a top down 2.5d physics based game.  The player uses thrust to move and change direction ala Asteroids.

I am wanting to make an indicator that shows what direction the playership is moving despite it's facing.  Specifically I need help with the math, and how to set up an FSM on my arrow gameobject.

Thank you for any help.
Chris

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Pointing to the direction of movement, not facing.
« Reply #1 on: April 04, 2018, 01:39:39 AM »
Hi,

You use the custom action GetGameObjectSpeed ( from the ecosystem) getting the speed as a vector3, then you normalize that vector to get the direction of movement as a unit vector, then you can multiply it by a length giving you the size of your indicator.

Bye,

 Jean