Answer the question
In order to leave comments, you need to log in
Search through transform.Find ray only once?
Is it really better to search through transform.Find("full path to the object") only once and save the link? or you can not take a steam bath if you specify the full path, then the unit will not particularly look for anything, what does this Find do in itself?
Answer the question
In order to leave comments, you need to log in
This is called caching.
If it is supposed that the object needs to be used more than once, then it is better to assign it in the Start or Awake method and use it further in the script. Rather than looking for and assigning this object every time.
It will be much more productive and smarter, that's all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question