playMaker

Author Topic: Child object rotation problem with iTween[SOLVED]  (Read 4366 times)

pixelrainbow

  • Playmaker Newbie
  • *
  • Posts: 9
Child object rotation problem with iTween[SOLVED]
« on: October 02, 2013, 06:01:23 PM »
Hello,

I have a problem using iTween Rotate To action. I have a gameobject that I set parent for another one. Now, when using iTween Rotate To, only the parent GO rotates but not the child. If I use Rotate (a'la Transform)then everything is fine and the child's rotation follows the parent as expected.

As I need to use iTween in my case, could you help me understand why the difference?
« Last Edit: October 08, 2013, 02:54:08 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Child object rotation problem with iTween
« Reply #1 on: October 03, 2013, 02:04:37 AM »
Hi,

 Are you positive that your hierarchy is correct? it could be that the child is indeed not parented when you start iTween.

 Bye,

 Jean

pixelrainbow

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Child object rotation problem with iTween
« Reply #2 on: October 03, 2013, 03:50:03 AM »
First of all, thanks for your reply.  And yes, it seems to be correct, when checking in Scene hierarchy the child object is indeed moved under the parent object (and in order to double-check, I also used Get Parent and logged the result in console).

I'll give some details, maybe it helps(?)...

1. Both GOs are instances of prefabs. Naturally, I refer to these using PlayMaker global vars, to be able to manipulate them from any GOs FSM.

2. I use the Set Parent PM action to attach one GO to the other as child.

3. A third GO's FSM is rotating the parent GO in the scene, using iTween Rotate To action. And the child oesn't follow then. If I replace here the iTween action to Transform.Rotate then everything is fine.

I don't know but it seems to be purely iTween related problem.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Child object rotation problem with iTween
« Reply #3 on: October 07, 2013, 03:04:17 AM »
Hi,

 Could you provide a test scene for me to look at?

bye,

 Jean

pixelrainbow

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Child object rotation problem with iTween
« Reply #4 on: October 07, 2013, 05:33:59 PM »
Hello,

I just found the solution now: I need to set the Is Kinematic property to true when I want to rotate the objects. With Is Kinematic on the child object follows the parent as expected.

Thanks for your time on this, much appreciated.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15502
  • Official Playmaker Support
Re: Child object rotation problem with iTween[SOLVED]
« Reply #5 on: October 08, 2013, 02:55:03 AM »
Hi,

 indeed, it's important to note that the go was a physics go and that itween will not perform on physics object unless set to "is kinematic".

bye,

 Jean