Search Unity

Time.realtimeSinceStartup

Discussion in 'Scripting' started by Laur155, Aug 18, 2017.

  1. Laur155

    Laur155

    Joined:
    Mar 2, 2017
    Posts:
    30
    Hi guys
    Can anyone tell me why this is not working i try it with a double variable and the same happend
    http://prntscr.com/ga838b
     
  2. PJRM

    PJRM

    Joined:
    Mar 4, 2013
    Posts:
    303
    coding problems should go on Scripting session.

    Ok, first:
    Change this
    Code (CSharp):
    1. Time.time.realtimeSinceStartup
    To this
    Code (CSharp):
    1. Time.realtimeSinceStartup
    Second:
    If you created a variable named Time, be aware that this word is already in use by UnityEngine! So you should do this:
    Code (CSharp):
    1. this.Time.text = UnityEngine.Time.realtimeSinceStartup;
    Hope this helps.
     
  3. Laur155

    Laur155

    Joined:
    Mar 2, 2017
    Posts:
    30
    Thank you