Hi Guys, I just want to know if it possible in the newer version of Unity to set the Y velocity of a Rigibody2D such as : Rigidbdy2D.velocity.y = 0; I always get the following error message : error CS1612: Cannot modify a value type return value of `UnityEngine.Rigidbody2D.velocity'. Consider storing the value in a temporary variable Thanks for the help !
try: Rigidbdy2D.velocity = new Vector2 (Rigidbdy2D.velocity.x, 0); or as error says, use Vector2 tmpVector = new Vector2 (something, something): Rigidbdy2D.velocity = tmpVector;