I was reading this thread about setting a script reference in the inspector versus using GetComponent
for the Unit script. If you do use GetComponent
for Unit specifically (which derives from NetworkBehaviour), which type of Start
/Awake
method should you put it in (should it be initialized on server and/or client and which methods achieve those)?
It seems to work in Awake
for me:
void Awake()
{
unitMovement = GetComponent<UnitMovement>();
}