playMaker

Author Topic: How to reset iTween Move's position to object's original values?  (Read 1152 times)

Neikke

  • Full Member
  • ***
  • Posts: 134
Hey folks, please help.

I want to kick out my Enemy objects from the scene. So I have static enemy object with simplest PlayMaker FSM which detects collision with Player and then kicks itself (Enemy object) out from the scene using iTween's "Move Add" and "Rotate By" actions.

The problem is that when those platforms are "reborn" and placed back to the scene, those Enemy objects are already in their kicked out and dead. Obviously, I have to somehow reset itween's animation changes but I can't seem to find such an option in those move and rotate actions.

Any ideas how to reset those animations and move the object back to its initial position? Thanks a lot!

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: How to reset iTween Move's position to object's original values?
« Reply #1 on: June 04, 2019, 04:59:32 AM »
Hey folks, please help.

I want to kick out my Enemy objects from the scene. So I have static enemy object with simplest PlayMaker FSM which detects collision with Player and then kicks itself (Enemy object) out from the scene using iTween's "Move Add" and "Rotate By" actions.

The problem is that when those platforms are "reborn" and placed back to the scene, those Enemy objects are already in their kicked out and dead. Obviously, I have to somehow reset itween's animation changes but I can't seem to find such an option in those move and rotate actions.

Any ideas how to reset those animations and move the object back to its initial position? Thanks a lot!

Just to clarify; iTween move add and rotate is not animating. Not trying to be a know it all, but just being clear about things because the instructions would be different.

Since we are talking about physical location/rotation; sounds to me like the easiest thing to do is a "Get Position" and "Get Rotation" just before you do the iTween actions. Then when you want the object back, you simply do a "Set Position" and "Set Rotation".

Neikke

  • Full Member
  • ***
  • Posts: 134
Re: How to reset iTween Move's position to object's original values?
« Reply #2 on: June 04, 2019, 07:19:39 AM »
@daniellogin

This definitely sounds good! I will try this get position/rotation method. Thanks a lot!