Search Unity

How to Change the tag in code

Discussion in 'Scripting' started by Mistre, May 20, 2009.

  1. Mistre

    Mistre

    Joined:
    May 10, 2009
    Posts:
    22
    I want to change the Object‘s tag in my JS code,anyway can do that? thanks very much
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    gameObject.tag = "whatever";

    --Eric
     
  3. Mistre

    Mistre

    Joined:
    May 10, 2009
    Posts:
    22
    I got it,thanks very much