Answers for "unity sendmessage vs getcomponent"

0

unity sendmessage vs getcomponent

SendMessage is absurdly much slower.
SendMessage has to go through every script,
look for a method with the same name using string comparrison (slower),
and call it. The GetComponent finds the script through type comparrison (faster),
and calls the method directly.
Posted by: Guest on January-13-2022

Browse Popular Code Answers by Language