videoPlayer Script Help Needed
I've made a 3D video player scene in between my main menu, and the game itself. It contains a plane with a Video Player component on it. I'm trying to make a simple script that changes the scene when the video ends. After a quick search through the Unity documentation, I found this page.
I followed the documentation and came up with this script.
GameObject TV = GameObject.Find("TV");
var videoPlayer = TV.GetComponent<UnityEngine.Video.VideoPlayer>();
void Update ()
{
if (videoPlayer.loopPointReached)
{
StartCoroutine(ChangeLevel);
}
}
The first part references the videoPlayer, and the simple if statement is triggered when the video ends. However, the script has given me an error, and I'm not sure how to fix it.
I'm quite new to C# programming, and I'd appreciate any help with this script. Thanks in advance!
Your answer
Follow this Question
Related Questions
c# coding question 1 Answer
Can't reference script. 1 Answer
load scene after video ended 2 Answers
List.Add() Not working? 0 Answers