Hi there,
Great course and im having fun fo far!
I dont know if this is because I am using unity 5 (although everything else I have googled when there are differences between unity 4 and 5 has come up with an answer) but anyway… I am at the part where I am trying to tweak the Vector on the OnCollisionEnter2D function and ‘rigidbody2D.velocity’ (not typing a string there!) comes with a red underline.
In Unity I get the error: Assets/Scripts/Ball.cs(41,25): error CS1061: Type UnityEngine.Component' does not contain a definition for
velocity’ and no extension method velocity' of type
UnityEngine.Component’ could be found. Are you missing an assembly reference?
Isn’t calling rigidbody like this incorrect anyway?
A lot of stuff I have seen when lookng online is that it is defines before it is called like this…an example definition would be like this:
RigidBody2D rb2d = GetComponent();
but I am not seeing anything like that so far in the script that we have been making that already exists? how does it just know what ‘rigidbody2D’ is?
My apologies if I am unclear…I’m not great at explaining these types of problems online haha…thanks for any help!
Matt