This code is suposed to add a force on the X axis every time I press SHIFT, but it just doesn't work, and if I try Vector2.up instead of Vector2.right it works, I don't understand why this is happening, but the velocity on the X axis is not working properly, can someone explain?
void Update()
{
if (Input.GetButton("Fire3"))
{
rb.AddForce(Vector2.right * force * Mathf.Sign(transform.localScale.x), ForceMode2D.Impulse);
}
}
↧