private void fire() { playerSession.AddAmmo(-1); getDirection(); GameObject arrow = Instantiate( ArrowPrefab, transform.position, Quaternion.Euler(0f, 0f, MathHelper.getAngle(direction) + 90f) ) as GameObject; arrow.GetComponent <Rigidbody2D>().velocity = direction.normalized * 300f * Time.deltaTime; }