Reply To: Why do we need the GetComponent at all at 4:13? We already have the projectile as a Rigidbody through the public variable.

Forum Archive Why do we need the GetComponent at all at 4:13? We already have the projectile as a Rigidbody through the public variable. Reply To: Why do we need the GetComponent at all at 4:13? We already have the projectile as a Rigidbody through the public variable.

#23014
Jason Finney
Participant

    But I thought it was necessary since the script was being added to the GameObject(empty) so in order to use the RigidBody of another GameObject(sphere prefab) didn’t it need the GetComponent to make a reference to the RigidBody component so we can edit the velocity?