playMaker

Author Topic: Can DoTween do ‘Stop on Exit’, like iTween can?  (Read 4264 times)

bkreeg

  • Playmaker Newbie
  • *
  • Posts: 4
Can DoTween do ‘Stop on Exit’, like iTween can?
« on: November 06, 2018, 02:32:46 AM »
I bit the bullet and purchased DoTween and the Playmaker actions. It seems great, but I really need to be able to replicate the feature from iTween “Stop on Exit”. I need a tween from one state to stop as soon as the FSM enters a different state, even if the tween hasn’t finished.

I’ve tried storing the tween with a String ID, but if I tell that ID to ‘pause’, it pauses ALL of the prefab instances in the scene. It’s like it’s behaving as a global setting, when I need it to behave individually for each instance of a prefab.

Can DoTween do this?

Thanks.

bkreeg

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Can DoTween do ‘Stop on Exit’, like iTween can?
« Reply #1 on: November 06, 2018, 03:19:53 PM »

Here are some more details, in case they help…

I have an object in the scene. If the player stands next to it, it shrinks right down to zero, but if they walk away before it has finished, it stops shrinking immediately. If the player returns, it resumes shrinking towards zero.

To make this happen, with iTween, I would have used a ‘Stop on Exit’ to make the object stop scaling down. But I can’t find anything that works the same in DoTween. In DoTween, I can only find ‘Pause by ID’ to stop it, and then ‘Play Forward by ID’ to start it up again. This works if there’s only one of these prefab objects in the scene, but I have many. And as soon as ‘Play Forward’ happens on one object, ALL the objects in the scene start scaling down together.

Does anyone know how I could achieve what I need by using DoTween? Can you start and stop tweens on one instance without it affecting all the others?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Can DoTween do ‘Stop on Exit’, like iTween can?
« Reply #2 on: November 16, 2018, 12:56:36 AM »
Hi,

 yes, I am sure you can do that, but you should contact the author to double check.

What actions are you using to control dotween?

Bye,

 Jean

edufurla

  • Junior Playmaker
  • **
  • Posts: 56
Re: Can DoTween do ‘Stop on Exit’, like iTween can?
« Reply #3 on: November 16, 2018, 06:34:27 AM »
Hi,
Since I stopped use Itween I bought "Playmaker Actions for DOTween by Doozy".
Don`t stopping when you leave the state is different at the beginning, but sometimes is good as you don`t have to create more than one FSM to make complex animations.
When I want to stop before the time ends, I kill the tween in the next state. You just have to remember to fill an id (or tag) in the dotween state.

note: You also "can pause by id" and "resume by id" to continue the animation later.
« Last Edit: November 16, 2018, 06:42:34 AM by edufurla »