Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.33k stars 350 forks source link

external pausing on GO #537

Closed vvp3 closed 2 years ago

vvp3 commented 2 years ago

I have a GO with few DOT Animations and 1 path. I also have a trigger colider 2d that I would like to stop the animations and the path movement.

I tried in many ways but the Animations do not stop OnTriggerEnter.

What should I do ?

vvp3 commented 2 years ago

i could solved the animations by disabling the manager + path paused separately i was after able to stop with dotween.pause(myGO) (i dont understand how it worked after but i think is because i added the path stopping)

so dopause is not pausing the path -- this is how it was supposed to work ?

Demigiant commented 2 years ago

Ahoy! I just checked and indeed the DOTweenPath component doesn't set its gameObject as a target automatically, so DOTween.Pause(gameObject) won't work on it. If you want, contact me here and add your invoice number in the message (so I know it's not a random github user but it's really you) and I will send you an update which sets the target automatically.

Alternatively, in the meantime you can set the same ID (in the Inspector) for the DOTweenAnimations and DOTweenPath and pause by id: DOTween.Pause(id);

Cheers, Daniele

vvp3 commented 2 years ago

I will send, thank you. And thanks for the TIP of both having same id.

There is a problem though:

I have multiple GO that have same components. Pausing by ID will stop the animations on all items. I want to achieve to stop on the object I collide with. I was able to get the components oncollision enter, so I should use the collision to get to the component i want and pause it.

It would be a nice iaddition to have somehting like DOTween.Pause(id, GO.tag, GO.layer); THis way i could have a script on my player that doesnt require to gt the components and make triggers all the time. Just a thought ;)