Reply To: I'm curious now: Is there a certain way that I need to code, to bring in the Rigidbody component? I was looking at the que…

Forum Archive I'm curious now: Is there a certain way that I need to code, to bring in the Rigidbody component? I was looking at the que… Reply To: I'm curious now: Is there a certain way that I need to code, to bring in the Rigidbody component? I was looking at the que…

#23029
Jonathan Gonzalez
Participant

    If you’re going to use something within the Rigidbody component you’ll need to use GetComponent, preferably in the Start function. So if you’re adjusting the speed/gravity of that rigidbody via code then you’ll use GetComponent first to cache that object. If you’re not doing any of that it’s not necessary. So in the script shown in the video it’s not necessary since we’re not using anything specific to rigidbodies, but just using it as a projectile.