I am creating an interactive video using Unity/C#. I am doing this using scenes and buttons that when clicked, go to the next scene or back. However, I want the buttons to appear once the video is finished. Is there any way I can add a delay to the buttons before they appear in the scene when playing?
How do i create a time delay before the button appears unity
331 Views Asked by geoffrey wilson At
2
There are 2 best solutions below
0
On
This should do the trick. isPlaying.
A simple script would look like this.
if(videoplayer.isPlaying == false && videoWasPlayed == true){
btn.active = true;
videoWasPlayed = false;
}
videoWasPlayed is used to check if the video was ever played. This would need to be set to true when the video is played.
For time delay you could use coroutines. Check it out here There is options like waitforseconds so you can delay your button apperance. here is sample code
And when you play video call this function like this