I am just getting into unity but I have been using unreal engine for quite a while. I am confused by this way of getting hold of a rigid body.
Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
I understand this is a way of doing it but it doesn’t make sense to me. I think that the first line is creating a varable of type Rigidbody. Then the rd = line of code I think fills it with the information the component rigid body. But then you can use this to set the velocity of the character with the rigid body component attached to it. Wouldn’t you need a pointer for this?
I just don’t understand whats going on. Does anyone know what this is really doing?