Adds a force to the rigidbody2D relative to its coordinate system.
public void AddRelativeForce(Vector2 relativeForce, [DefaultValue("ForceMode2D.Force")] ForceMode2D mode) { INTERNAL_CALL_AddRelativeForce(this, ref relativeForce, mode); }
// Use this for initialization void Start() { r2d = GetComponent<Rigidbody2D> (); if(Movimentacao.left){ r2d.AddRelativeForce (new Vector2 (-speed, 0)); }else{ r2d.AddRelativeForce (new Vector2 (speed, 0)); } }