I have a Slate Action that displays a subtitle when the action is triggered. For a longer cutscene, I’m trying to resume playing the cutscenes somewhere in the middle of the cutscene (instead of at time = 0). I’m finding that when the cutscene first starts, Slate is triggering all actions on the first frame. The result is that all of my subtitle actions that occurred earlier than the start time get triggered as soon as the cutscene plays.
For example, say I display a subtitle every 10 seconds in a cutscene. If I were to start the cutscene at Time = 45 seconds, I’d see 4 subtitles appear immediately upon playing the cutscene.
I understand why the system works this way, but I was wondering if there was some options I’m missing to get a particular action to ignore that behavior, and not fire when the cutscene is “catching up” with all past events?
This is indeed done by design so that the cutscene is deterministic. You can however use the following code in your custom action clip to avoid it being triggered in such situations:
1
2
3
4
5
6
7
protectedoverridevoidOnEnter()
{
if(root.previousTime==0){return;}
//...
}
Please let me know if that works for you, or if you’d like some other solution.
Thank you!
It does, however, have one downside: If I actually have the clip start at t=0, it will never play that clip, since root.previousTime will be zero in that case. A simple workaround for that is I just won’t put these clips exactly at t=0, and I can put a warning on OnEnter if startTime == 0.
So, works well for my purposes. Thanks again.
Author
Posts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.