- Home /
How can I make a menu pop-up after a video is finished playing?
Hello! thank you for taking the time to read my question.
I am a complete beginner just learning through the unity tutorials.
Recently, I am working on a 360 degree video scene and I want a menu to appear when the video is finished playing. I have tried some things by modeling what other people have done in other questions but it doesn't appear to be working. I'm sure I'm probably missing something very basic so I would be very grateful for any help.
This is the code I have:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Video;
public class VideoMenuManager : MonoBehaviour {
public VideoPlayer VideoPlayer;
public GameObject VideoMenu;
// Use this for initialization
void Start () {
VideoPlayer = GetComponent<VideoPlayer>();
VideoPlayer.loopPointReached += EndReached;
VideoMenu.SetActive(false);
}
void EndReached(UnityEngine.Video.VideoPlayer vp)
{
VideoMenu.SetActive(true);
}
For an easy template get cinemachine
Window > Package$$anonymous$$anager select Cinemachine and the Install.
In the sample scenes they have pop-ups, you could copy what they have used. If its not there then download Cinemachine from the Asset Store I'm recommending this because you're doing a scene with a video or something and cinemachine can do that quite easily.
Thank you! That sounds perfect, I'll try it out.
Your answer
![](https://koobas.hobune.stream/wayback/20220612171122im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Playing Video When Clicked (Stay Paused In Scene) 0 Answers
Unity 360 Video not centered. 0 Answers