playMaker

Author Topic: After rotate my gameobject still moves in old Z axis [SOLVED]  (Read 1440 times)

Grendal

  • Playmaker Newbie
  • *
  • Posts: 31
After rotate my gameobject still moves in old Z axis [SOLVED]
« on: August 28, 2015, 04:56:56 PM »
I know I am missing something elementary so maybe a fresh mind can point it out.

I have a gameobject that periodically rotates in a random direction. It is then supposed to move forward (local Z) for a period of time then repeat. All works well except that it always moves in the Z of the original transform (ie. the direction the gameobject was facing when game started). I have tried getting rotation and setting it prior to move and have stored object transform.. but unable to figure out how to set objects transform from variable..

any ideas on how I should best approach this?

UPDATE:
I am using itween rotate add to rotate the cube and I am playing an animation while it rotates. The itween exits using the Finished exit event and the animation is set to stop on exit. The animations are on an object parented to a control object which is being rotated. From watching it run using scene view the parent control object isn't even rotating, only the child object is... however, I am specifically using the control object inside the itween action (drag-drop). I tried disabling the animation.. still doesn't rotate specified GO...

Also.. my animations are on the child object so during the rotating state I play animations pointing at the child object, then itween rotate pointing at parent object.. (I have switched the order.. no different).. in prior states to this I play animations from child as well... do I need to tell playmaker that parent is back in focus somehow prior to using itween?
« Last Edit: August 29, 2015, 06:59:05 AM by Grendal »

Grendal

  • Playmaker Newbie
  • *
  • Posts: 31
Re: After rotate my gameobject still moves in old Z axis [SOLVED]
« Reply #1 on: August 29, 2015, 06:58:38 AM »
I managed to get it working correctly. I went through my state graph block by block and changed many to sequential actions which helped with flow.
When I got to my rotate states the gameobject parameters were empty.. for some reason when I was working yesterday I would input data in the fields and run the game but when I stopped game the fields were reset to empty again.

I reattached the gameobjects tonight and it worked perfectly and I didn't have the empty fields problem any tonight.. oh well, at least it works now. :)