playMaker

Author Topic: How to ignore parent's rotation?  (Read 162 times)

fromfame

  • Junior Playmaker
  • **
  • Posts: 65
  • Sloppy PM Veteran
    • View Profile
How to ignore parent's rotation?
« on: July 20, 2019, 03: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?

Thore

  • Sr. Member
  • ****
  • Posts: 275
    • View Profile
Re: How to ignore parent's rotation?
« Reply #1 on: July 20, 2019, 03: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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14316
  • Official Playmaker Support
    • View Profile
Re: How to ignore parent's rotation?
« Reply #2 on: July 26, 2019, 01: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

hoyoyo80

  • Junior Playmaker
  • **
  • Posts: 74
    • View Profile
Re: How to ignore parent's rotation?
« Reply #3 on: July 27, 2019, 01:40:23 AM »
Dont parent it. Use Get Position and Set Position every frame of the object you want to follow👍

Broken Stylus

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: How to ignore parent's rotation?
« Reply #4 on: July 29, 2019, 09:27:00 AM »
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)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14316
  • Official Playmaker Support
    • View Profile
Re: How to ignore parent's rotation?
« Reply #5 on: July 30, 2019, 03:19:23 AM »
Hi,

 Cool, did not know about these new components!

Bye,

 Jean