- Home /
Question by
Lazersharkzz · Jan 29, 2019 at 02:25 PM ·
terrainterraincollider
Unity Terrain Update
I was using the terrain tool in an older version of Unity but I just updated to the latest version. After this update whenever my character walks into a vertical piece of terrain, they will just walk right through it.
This is my code for movement
`if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.W) ||
Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.A) ||
Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.S) ||
Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.D))
{
if (Stamina.fillAmount > 0)
{
GetComponent<Rigidbody>().MovePosition(transform.position + (transform.right * MoveSpeed * 2 * Time.deltaTime * Input.GetAxis("Horizontal")) + transform.forward * MoveSpeed * 2 * Time.deltaTime * Input.GetAxis("Vertical"));
Stamina.fillAmount -= 0.005f;
Run = true;
}
}`
Does anyone know why this might be happening?
Comment