Reply To: Enable and disable tracks by script

Slate Forums Support Enable and disable tracks by script Reply To: Enable and disable tracks by script

#2118
Gavalakis
Keymaster

Hello there,

Enable/Disable tracks is possible but please note that is only when the cutscene is not already playing. If the cutscene is already playing then unfortunately that is (at least right now) not possible.

To enable/disable a track, you need to use the API to find that track. This is done with the ‘Cutscene.FindElement(string path)’ method. For this to work, you need to manually name the Group as well as the Track you want to find (done in the inspector of Group and Track respectively).

So, for example if you want to find an Audio Track that you have named “MyTrack”, and which lives under a Group which you have named “MyGroup”, you can then do this:

cutscene.FindElement<CutsceneTrack>("MyGroup/MyTrack").isActive = false

Please let me know if that works for you.

Thanks 🙂

Join us on Discord: https://discord.gg/97q2Rjh