I have a plane with mesh collider,
and a character with a rigidbody and capsule collider.
I use addForce in my script to control my character movement,
but the character keep colliding with the terrain and hence my character cannot walking properly.
As I need physic in my game so I believe I have to keep my rigidbody,
how can I modify it so that my character can walk smooth on the plane?
A simple video showing the collision with the plane
with my controlling scipt:
public class playerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody> ();
}
// Update is called once per frame
void FixedUpdate () {
float horizontal = Input.GetAxis ("Horizontal");
float vertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (horizontal,0.0f, vertical);
rb.AddForce (movement * speed);
}
}