I have a character being moved using rigidbody.moveposition and I have an floating lowpoly island with a mesh collider. When my player walks into a steep slope or a wall, it passes right through. I assume this is because the mesh collider isn't thick enough but there must be a pretty simple fix. If anyone knows how to fix this it would be much appreciated.
Here's the code for the movement of my character.
private void Movement()
{
if (AnimController.GetInteger("AnimPar") != 3)
{
if (Input.GetKey(KeyCode.LeftShift))
{
walkSpeed = initialWalkSpeed * 2;
}
else
{
walkSpeed = initialWalkSpeed;
}
if ((Forward && Right) || (Forward && Left) || (Backward && Right) || (Backward && Left))
{
walkSpeed *= .7f;
}
if (Forward)
{
Delta += transform.forward * walkSpeed * Time.deltaTime;
}
if (Backward)
{
Delta -= transform.forward * walkSpeed * Time.deltaTime;
}
if (Right)
{
Delta += transform.right * walkSpeed * Time.deltaTime;
}
if (Left)
{
Delta -= transform.right * walkSpeed * Time.deltaTime;
}
rb.MovePosition(new Vector3(Delta.x, transform.position.y, Delta.z));
}
}