Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: krmko on October 24, 2017, 06:40:45 AM

Title: Rotating child object towards parent [SOLVED]
Post by: krmko on October 24, 2017, 06: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.

(https://s26.postimg.org/5ymh7r7yh/image.png)

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?
Title: Re: Rotating child object towards parent
Post by: Groo Gadgets on October 24, 2017, 08: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
Title: Re: Rotating child object towards parent
Post by: krmko on October 24, 2017, 09:10:45 AM
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!
Title: Re: Rotating child object towards parent
Post by: jeanfabre on November 02, 2017, 12: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
Title: Re: Rotating child object towards parent
Post by: krmko on May 14, 2018, 05: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 :)