Why not just grab the component in code?

At about 5 minutes into the video you define the Animator unitAnimator to be a [SerializedField] to be assigned through the editor.

Is there any reason not to use this?

private void Awake()
{
  unitAnimator = GetComponentInChildren<Animator>();
}
1 Like

Either method is acceptable. Some prefer direct assignments.

One advantage to Serializing, however, is that it does help to reduce race conditions.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms