Hello, I am developing an endless runner style game, the character will always go forward, there is no problem with this, I can do it as I want with addforce, but it does not go when it needs to go left and right. How can I do it using rigidbody and addforce.
rb.AddForce(new Vector3(Input.GetAxis("Horizontal"), transform.position.y, speed) * (Time.fixedDeltaTime * 2));
This is the last code I tried
↧