Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This is not the actual script used in the video, it's just a few lines that I extracted so you can copy/paste them if needed.
- //Finding the game object by name, then accessing the component:
- GameObject.Find("ObjectB").GetComponent<ScriptB>();
- //Finding the game object by tag, then accessing the component:
- GameObject.FindWithTag("ObjectBTag").GetComponent<ScriptB>();
- //Finding the first game object that has this script attached to it:
- GameObject.FindObjectOfType<ScriptB>();
Advertisement
Add Comment
Please, Sign In to add comment