Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: fromfame on July 20, 2019, 06:14:10 PM

Title: How to ignore parent's rotation?
Post by: fromfame on July 20, 2019, 06:14:10 PM
I've got an object which must stay a child of another object, however it shouldn't be affected by it's rotation.

Is there any where to ignore a parent's rotation?
Title: Re: How to ignore parent's rotation?
Post by: Thore on July 20, 2019, 06:39:02 PM
Not possible. You could always set the rotation to the value you want. You could unparent it, and set only the transform position from the parent. You could make another game object that is not parented, and copy that game objects transform value and so on.
Title: Re: How to ignore parent's rotation?
Post by: jeanfabre on July 26, 2019, 04:25:13 AM
Hi,

 You can reset the rotation to any world rotation value in late update, but this requires caching the initial world rotation first.

as thore said: a probably easier way is to no have it parented and have an fsm that set the position of the "child" to its parent on late update, then it will seems parented, but only position is affected.

 Bye,

 Jean
Title: Re: How to ignore parent's rotation?
Post by: hoyoyo80 on July 27, 2019, 04:40:23 AM
Dont parent it. Use Get Position and Set Position every frame of the object you want to follow👍
Title: Re: How to ignore parent's rotation?
Post by: Broken Stylus on July 29, 2019, 12:27:00 PM
Typically, it would seem to be a typical case of creating a big wheel with horizontal platforms attached to it, like in Mario.
As the others have said, the rotating element and the others have to be separate, but you could put all of them into a bigger parent.
I remember using other tools which had a nice option such as block/ignore rotation for an object.
You may want to try the following constraints (components):
Parent constraint
https://docs.unity3d.com/Manual/class-ParentConstraint.html
Rotation constraint
https://docs.unity3d.com/Manual/class-RotationConstraint.html
Not exactly what I'd call intuitive solutions, so you need to do simple tests first to observe the behaviors of some parents and their respective children.
Good luck pilot!  8)
Title: Re: How to ignore parent's rotation?
Post by: jeanfabre on July 30, 2019, 06:19:23 AM
Hi,

 Cool, did not know about these new components!

Bye,

 Jean