playMaker

Author Topic: Rotation towards movement direction but with translating movement [SOLVED]  (Read 1328 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
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.
« Last Edit: June 01, 2019, 05:37:42 PM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Rotation towards movement direction but with translating movement
« Reply #1 on: May 31, 2019, 09: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?
« Last Edit: May 31, 2019, 09:50:42 AM by krmko »
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Rotation towards movement direction but with translating movement
« Reply #2 on: May 31, 2019, 10:26:42 AM »
Or maybe simply rotate towards last frame position but in opposite direction, hmmm.
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Got it the simple way. Get position, look at with 180 degree offset in the next state, loop.
Available for Playmaker work