Cant move up/down terrain character controller network multiplayer game
Hello im making a game and i followed some tutorials and im trying to learn. but im having a huge problem suddenly with moving up/down terrain the players just moves mid air or will not go up terrain.
i have a ridgedbody and character controller ive tryed with and without. i allsow have a terrain collider on my terrain witch i added a physics material (stone) just in case...
This is my CharacterController script:
using UnityEngine; using UnityEngine.Networking; using System.Collections;
public class PlayerController : NetworkBehaviour {
public override void OnStartLocalPlayer() { GetComponent().material.color = Color.blue; Camera.main.GetComponent().target=transform; //Fix camera on "me"
}
void Update () { if (!isLocalPlayer) { return; } var x = Input.GetAxis("Horizontal") Time.deltaTime 150.0f; var z = Input.GetAxis ("Vertical") Time.deltaTime 3.0f;
transform.Rotate (0, x, 0);
transform.Translate (0,0,z);
} }