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.

Question Where to put a script ?

Discussion in 'Formats & External Tools' started by kjhall1985, Oct 6, 2020.

  1. kjhall1985

    kjhall1985

    Joined:
    Aug 15, 2020
    Posts:
    2
    I have got a text revealing script but not sure where exactly it goes ?!
    I basically want it to appear as I approach the object . Do I make a canvas and text UI on the object ? Or a empty object ? Comment please or dm
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,080
    can you show the script?
    really depends on the script that what it does and what component it uses..
     
    kjhall1985 likes this.
  3. David42142

    David42142

    Joined:
    Jul 15, 2015
    Posts:
    13
    Attach a Script to the object and in the Update() method check the distance to the player.
    if its under some threshhold set the GameObject that holds the UI to active.
     
    kjhall1985 likes this.
  4. kjhall1985

    kjhall1985

    Joined:
    Aug 15, 2020
    Posts:
    2
    Thanks I’ll try that