playMaker

Author Topic: Rotating child object towards parent [SOLVED]  (Read 2021 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Rotating child object towards parent [SOLVED]
« on: October 24, 2017, 09:40:45 AM »
Well, it's kinda harder to explain, so i made this neat little drawing, sorry, i'm at my office so i drew it with mouse.



I've got engine jets that are childed to the ship, and they always stay as they are, no matter if the ship moves up or down. What i want is to rotate them slightly when the ship moves up or down, as described in the picture. Now, if it wasn't childed, i could rotate it towards, but as it keeps it's local position, that doesn't work of course.

By the way, i use translate for moving the ship, i don't know what property should i listen to to adjust the rotation of the jet according to the ship movement?
« Last Edit: May 14, 2018, 08:20:53 AM by krmko »
Available for Playmaker work

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
Re: Rotating child object towards parent
« Reply #1 on: October 24, 2017, 11:12:12 AM »
Heya,

If the ship is the player you can use the input as the base for the jet rotation. Use the float remap action from the Ecosystem to remap the input value to a suitable rotation angle. I've done a similar technique in my spaceship game  :-)

Cheers,

Simon

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Rotating child object towards parent
« Reply #2 on: October 24, 2017, 12:10:45 PM »
Hi mate, thanks for the suggestion, i will use it for the players ship for sure! Unfortunately, this is for the enemies, moving via tween and velocity/translate.

Hm, but i may use float remap for enemies too, i'll try it out!
« Last Edit: October 25, 2017, 02:40:50 AM by krmko »
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rotating child object towards parent
« Reply #3 on: November 02, 2017, 03:13:13 AM »
Hi,

 you could also get the speed of the gameobject ( get GameObjectSpeed on the ecosystem), which will give you the direction and that;'s would be where your engine should look at.

 however for more believable effect, indeed listening to the input would allow the engine to act before the ship actually moves giving a more believable effect visually.

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Rotating child object towards parent
« Reply #4 on: May 14, 2018, 08:20:29 AM »
I completely forgot about this one. Thanks everyone for answering, in the end it was more elegant to make new animations, and it looks better when using pixel art :)
Available for Playmaker work