Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: krmko on May 30, 2019, 03:56:39 AM

Title: Rotation towards movement direction but with translating movement [SOLVED]
Post by: krmko on May 30, 2019, 03:56:39 AM
Hi all,

i'm trying to find a solution for rotating some missiles towards direction.

After they're being fired they are moved using translate with no set target. I'm not using velocity so i can't get the direction with velocity data (it's 0,0 since i'm translating the missiles), and i don't know how can i get the direction every frame to apply the rotation by using some other method.

All ideas except "move them using velocity" are welcome  ;D

Edit: of course, the child will be rotating so it doesn't affect the movement.
Title: Re: Rotation towards movement direction but with translating movement
Post by: krmko on May 31, 2019, 06:38:32 AM
I was just wondering, if i get the current position and last frame position, and subtract current from last frame position i should be getting the vector that shows the missile's heading. How can i apply that vector to the rotation of the child object?
Title: Re: Rotation towards movement direction but with translating movement
Post by: krmko on May 31, 2019, 07:26:42 AM
Or maybe simply rotate towards last frame position but in opposite direction, hmmm.
Title: Re: Rotation towards movement direction but with translating movement [SOLVED]
Post by: krmko on June 01, 2019, 02:38:45 PM
Got it the simple way. Get position, look at with 180 degree offset in the next state, loop.