Hello again,
Well, using a tween engine is not a very good practice to do within a sequencer like Slate, because the tween will run completely independent (or like you said “on a different thread”) than the sequencer does, especially if it’s just a “fire and forget”. So, you will need to tell DOTween to kill the tween. Bellow is an example how you should do it.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
publicclassBlinkColor:ActorActionClip{
[SerializeField]
privatefloat_length=1f;
publicColor color;
privateTween tween;
publicoverridefloatlength{
get{return_length;}
set{_length=value;}
}
protectedoverridevoidOnEnter(){
tween=actor.DOColor(color,length);
}
protectedoverridevoidOnExit(){
tween.Kill();
}
}
On the other hand, you can of course just use the included action clip “Animate Material Color” and keyframe the color over time exactly like you want 🙂
Let me know if these work for you.
Cheers.
Join us on Discord: https://discord.gg/97q2Rjh
Attachments:
AnimateColor.png
Login
Register
By registering on this website you agree to our Privacy Policy.