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

Why do we need the GetComponent at all at 4:13? We already have the projectile as a Rigidbody through the public variable.
  • Jonathan Gonzalez(jgonzalez) replied

    Yes I see what you’re talking about, it was unnecessary since we don’t need to access anything within the component itself. Not sure why I added it actually as I never do that with projectiles. Thanks for pointing it out.

  • demonslayer112 replied

    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?