Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

::HELP:: Scripting issues

Discussion in '2D' started by seventyD, May 7, 2016.

  1. seventyD

    seventyD

    Joined:
    May 6, 2016
    Posts:
    2
    In this script in using the pos of the player as score and im having some errors, anyone know what to do?

    My script:
    http://pastie.org/10827954

    ERRORS:
    Line 7-10:
    The type or namespace name `Text' could not be found. Are you missing a using directive or an assembly reference?


    PLZ HELP ASAP
     
    Last edited: May 7, 2016
  2. seldom

    seldom

    Joined:
    Dec 4, 2013
    Posts:
    118
    line 8 misses a semicolon, line 10 misses a variable name and semicolon.
     
  3. seventyD

    seventyD

    Joined:
    May 6, 2016
    Posts:
    2
    Thanks, I have new problems now, i changed the pastebin
     
  4. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    >>public Text Player

    missing the semicolon - that's why the next line says unexpected public.
     
  5. Tom01098

    Tom01098

    Joined:
    Jun 8, 2015
    Posts:
    42
    Heya, the Text type is located under the 'UnityEditor.UI' namespace. So, at the top of your script, write 'using UnityEditor.UI;'
     
  6. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    This isn't an editor script, so he should use "UnityEngine.UI".
     
  7. Tom01098

    Tom01098

    Joined:
    Jun 8, 2015
    Posts:
    42
    Ah woops, I always make that mistake :(