Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Roboboy1 on December 31, 2013, 12:38:54 PM

Title: iTween not finishing with fast interaction[SOLVED]
Post by: Roboboy1 on December 31, 2013, 12:38:54 PM
Hey guys,
I've been having some problems with itween actions not finishing esp. when the user interacts too quickly with collision objects(rapid mouse clicking, etc.). I have an itween "rotate to" action with a duration of .5 seconds which is pretty fast, but what do you do about users that rapidly click around and the action gets stuck on the itween state? Any help would be much appreciated.
Title: Re: iTween not finishing with fast interaction
Post by: jeanfabre on January 02, 2014, 06:08:11 AM
Hi,

you don't get stuck in a state, create a logic that activate another state and you are good to go if your itween action "stops" on exit.

 The key is to always use the start position or rotation for your itween action using the current value and not the expected one if that itween had finished, and so it will start a new itween using the current position or rotation, that's perfectly valid even at fast pace.

Bye,

 Jean
Title: Re: iTween not finishing with fast interaction
Post by: Roboboy1 on February 16, 2014, 06:40:58 PM
Hi Jean,
I think that is how I have it set up already. Please see the enclosed image. I have several collision objects that send an event to their respective receivers. The receiver compares an int and if its "1" it transitions to a state with the itween rotate to. If I rapidly click the collision objects they eventually stop working. This screen cap shows where its getting hung up. Do you mean "activate another state" on the same FSM?
Title: Re: iTween not finishing with fast interaction
Post by: jeanfabre on February 17, 2014, 10:29:23 AM
Hi,

 Manually send the "FINISH" event. Better create a "DONE" event tho, but this would be what I woudl experiment with.

bye,

 Jean
Title: Re: iTween not finishing with fast interaction
Post by: Roboboy1 on February 17, 2014, 11:09:06 PM
The extra transition did the trick. Every mesh collider now sends an event to the parent of all the receivers that calls this extra transition. Tests so far have been bullet proof. BTW - I hadn't used the parent as the target before. I guess this replaces the old broadcast method? Very nice! This will simplify several of my FSMs.