When i run the project the videoplayer starts playing straight away (i can hear the audio), and continues even when the target has left the cameras pov.
I want the video to start playing once the target has been seen by the ARcamera . . . and then stop when the camera can no longer see it.
Is there an easy way to do this? like in the inspector?
I suspect some c# is gunna be necessary. I have been trawling th internets and haven’t been able to get it going yet:( I am still new to c# (&unity), so please be gentle with me!
Any help very gratefully received:)
2 Answers
2Have you found an answer? I am having the same issue. Thanks.
In the Inspector, there is a check box labelled ‘Play On Awake.’ Unchecking this should stop the video from playing straight away. To make the video play/stop upon seeing the target, you will have to use code. Put VideoPlayer.Play() in whatever function runs when you see the target. Likewise, VideoPlayer.Stop() will stop the video.
well fair point, it doesn't. private void OnMouseDown() { if(routineRunning) return; routineRunning = true; StartCoroutine(MovementRoutine()); }
– Captain_Pineapple