Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: CuriousRodeo on April 03, 2018, 11:34:46 AM

Title: Pointing to the direction of movement, not facing.
Post by: CuriousRodeo 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
Title: Re: Pointing to the direction of movement, not facing.
Post by: jeanfabre 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