playMaker

Author Topic: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?  (Read 2543 times)

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Hey all~

The title pretty much explains my problem, I do not want my child object to rotate when my parent object does :<

Is there a way to do this in playmaker?

Thanks in advance

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14014
  • Official Playmaker Support
    • View Profile
Hi,

 The simple solution is to unparent the child you don't want to rotate, rotate the parent and then re attached the child.

 If this is not possible ( for example, if the child need to move but not rotate), then, either you move the child to follow the parent, else, you apply a counter rotation to the child at the same time as you rotate the parent. So if you rotate by 10 degree on the x axis, rotate the child by -10 degree on the x Axis using the parent as reference.

Try the first and second solution, if you need a counter rotation, you'll need a custom action to expose rotateAround within playmaker. If you can't write the custom action yourself, le me know, and I'll do it.

 Bye,

 Jean


Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Oo thanks again Jean~ ^^

I cannot write a custom action by myself yet, still reaching that stage, hopefully some time soon ;)

>would greatly appreciate it if you could make one ^^

Thanks again~

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14014
  • Official Playmaker Support
    • View Profile
Hi,

 Here we go:

http://hutonggames.com/playmakerforum/index.php?board=19.0

Basically, rotate the parent, and use rotateAround on the child by the inverse amount and done.

I have attached a package doing just this.


Bye,

 Jean

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Thanks a lot~ :D

You are a legend :D