I have searched thoroughly and asked elsewhere but can’t get an answer that doesn’t baffle me. I’ve read the doc about GetComponent, but trying to incorporate the example just gives errors like “radarscript doesn’t exist in the current context”.
There must be an understandable way to replace “anything” with “player”
Can I update “anything” to “player” with c# once “player” is instantiated?
Transforms = GameObject.Find(“anything”).transform;
Your question is confusing. You can execute the line you specify using ‘Player’ as long as a game object with the name ‘Player’ exists at the time the line is executed. If it does not exist, then this line will generate a null reference exception. Also note that by convention, variables should start with a lower case letter.
"radarscript doesn't exist in the current context".
This is the syntax I was after…
GameObject temp = GameObject.Find ("playerSHIP(Clone)/localSHIP");
GameObject.Find("RadarMgr").GetComponent<RadarScript>().Transforms = temp.transform;