Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Grave_sts on January 31, 2012, 08:09:53 AM

Title: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?
Post by: Grave_sts on January 31, 2012, 08:09:53 AM
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
Title: Re: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?
Post by: jeanfabre on January 31, 2012, 02:21:59 PM
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

Title: Re: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?
Post by: Grave_sts on February 02, 2012, 12:48:48 AM
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~
Title: Re: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?
Post by: jeanfabre on February 09, 2012, 03:11:38 AM
Hi,

 Here we go:

http://hutonggames.com/playmakerforum/index.php?board=19.0 (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
Title: Re: How to prevent my gameObject (child) from rotating with my GameObject (Parent)?
Post by: Grave_sts on February 13, 2012, 08:10:22 AM
Thanks a lot~ :D

You are a legend :D