variables ?

I understand declaring variables eg. projectile is of the type Rigidbody, as below:

var projectile: Rigidbody;

What I don’t quite understand is what I am doing when I drag the variable over to the script in the Inspector ?

Can this be done in code as an alternative approach ?

Thanks

Hi,

All it’s doing is setting the value.

It’s the same as saying

projectile = MyProjectile1;

if you dragged MyProjectile1 in the editor to that script variable.

Thanks, obvious I suppose :sweat_smile: