using System.Collections; using System.Collections.Generic; using UnityEngine; public class elevationController : MonoBehaviour { public CharacterController charController; public float IncrementLevel; Vector3 mDir; bool up; bool dwn; // Start is called before the first frame update void Start() { mDir = Vector3.zero; bool up = false; bool dwn = false; } public void goinUp() { mDir.y = IncrementLevel; } public void goinDwn() { mDir.y = -IncrementLevel; } // Update is called once per frame void Update() { if(up == true) { goinUp(); } if(dwn == true) { goinDwn(); } charController.Move(mDir); mDir = Vector3.zero; return; } }