using gameobject.find('key') but i want to make it with a tag
so i i am creating a game where you need to find keys and pick them up. although i will need to assign a tag or make many different scripts for each key
carryingBlue = true; GameObject.Find('key').transform.parent = GameObject.Find('MainCamera').transform;
this is just a sample but i would like to change the gameobject.find(key) to find a tag
Answer by Ardaaytac · Aug 31, 2016 at 01:09 PM
Please look at the documentation. https://docs.unity3d.com/ScriptReference/GameObject.FindWithTag.html Note: Don't use GameObject.Find too much if your on Android or iPhone,also don't use it in Update function. Use a public array instead. @Jrusso17
Your answer
Follow this Question
Related Questions
Problems with Physics.Raycast 0 Answers
Why doesnt Gameobject.find not work? 3 Answers
GameObject.Find(CaseInsensetive) ? 1 Answer