Home

Published

- 1 min read

how to access gameobject name

img of how to access gameobject name

The solution for this is noted below

how to access gameobject name

Solution

   // note how the 'g' is lowercase, when it's lowercase it accesses the GameObject its attached to
gameObject.name
// so if this script was attached an object named "Player", it will access "Player"

Try other methods by searching on the site. That is if this doesn’t work