Error : “An object reference is required for the non-static field,method or property ‘UnityEngine.Rigidbody2D.velocity.get’(CS0120)”
I am new to unity and started today only. Please help.
Error : “An object reference is required for the non-static field,method or property ‘UnityEngine.Rigidbody2D.velocity.get’(CS0120)”
I am new to unity and started today only. Please help.
Velocity must be in vector2 for 2d games so that the game knows both the velocity and direction. Example:
a.velocity = new Vector2(1.5f,-8.5f);
a would be you rigidbody2d, first number is speed on x axis, and the second is speed on y axis. The f indicates that they are floats.