unity find gameobject by name
GameObject enemy = GameObject.Find("enemy");
unity find gameobject by name
GameObject enemy = GameObject.Find("enemy");
Gameobject.Find in unityC#
GameObject sphere = Gameobject.Find("Player");
// above code will search whole scene for the gameobject named "Player"
//
GameObject sphere = Gameobject.Find("/Player");
//above code will search the gameobject named "Player" but this gameobject cannot be a child
GameObject sphere = Gameobject.Find("/player/gun");
//above code will search the gun gameobject which must be the child of Player
// and player must not be the child of any other.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us