- Home /
Question by
Dragonus · Oct 16, 2019 at 05:04 AM ·
c#objectsgameobjectsupdate functionupdate problem
Finding object in update function not working.
When player jumps to another car, it renames to "CarPlayer" and his first car gets renamed to "Car". But when i do this operation, i want my camera script to find and follow another object with name "CarPlayer", but i dont know how to find this object.
void Awake()
{
Player = GameObject.Find("Player");
CarPlayer = GameObject.Find("CarPlayer");
}
void Update()
{
CarPlayer = GameObject.Find("CarPlayer");
}
But this doesn't work. Please help me
Comment
Your answer
Follow this Question
Related Questions
Object creation in Update 1 Answer
Update breaks function 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
why do these both codes work similarly when they are put inside update function... 2 Answers