Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

[Unity] How to make a Game object Appear?

Discussion in 'AR/VR (XR) Discussion' started by HeHeHaHa306, Mar 15, 2017.

  1. HeHeHaHa306

    HeHeHaHa306

    Joined:
    Feb 10, 2017
    Posts:
    24
    Hi Guys,

    I just create a VR APP for running a 360 video on my phone with google cardboard SDK but need to do some

    trigger for that .

    so my aims is when I open the app and the video will be Autoplay when its start, 3mins later (the end of the video), there are 2 button (I made it already) appear for the viewer and now my question is how to make it appear?

    Basiclly, my idea is make a timer that count to 3 mins and make the button appear. Is it right?

    btw, does anyone can give me some help about this? I don't even know how to create a timer, thank you!

    Have a good day
     
  2. trd99

    trd99

    Joined:
    Dec 27, 2013
    Posts:
    13
    there are a few ways, listed in order of desirability:

    1. is there a finished event for the video player? consult documentation or write author if bought off asset store. show buttons when finished event when fired.
    2. is there an isPlaying method or variable for video player? same solution to find. check variable in a loop, whether update() or coroutine. downside is checking variable constantly to semi-constantly.
    3. timer, not desirable due to fact you may change the video and subsequent length, so you would have to change the timer with each video edit. you can google for a solution or buy a solution off the asset store (there are several). http://answers.unity3d.com/questions/225213/c-countdown-timer.html

    as far as showing objects, google "unity show hide gameobjects setactive".
     
  3. HeHeHaHa306

    HeHeHaHa306

    Joined:
    Feb 10, 2017
    Posts:
    24
    thank you very much trd99! it's helpful
     
unityunity