void Start() { inst = this; contactPoint = transform.position; // prevents sliding on game start ms = MascotAnimatorController.inst; jumpSpeedAtStart = jumpSpeed; gravityAtStart = gravity; controller = GetComponent <CharacterController>(); myTransform = transform; speed = walkSpeed; rayDistance = controller.height * .5f + controller.radius; slideLimit = controller.slopeLimit - .1f; jumpTimer = antiBunnyHopFactor; #if UNITY_IPHONE && !UNITY_EDITOR touchAxes = true; #else touchAxes = false; #endif }
public void SetInstance() { inst = this; }