private void FixedUpdate() { // Read the inputs. float h = CrossPlatformInputManager.GetAxis("Horizontal"); // Pass all parameters to the character control script. m_Character.Move(h, m_Jump); m_Jump = false; }
// Update is called once per frame void Update() { if (!UIManager.isPause && !CharacterAnimation.Win) { CanMove = !ObjEat.unityChanDie && !ObjEat.HitInvincible; if (isBtnRightDown && CanMove) { cMove.turningPoint = false; cMove.Move(false); } } }
// Update is called once per frame void Update() { float vertical = Input.GetAxis("Vertical"); float horizontal = Input.GetAxis("Horizontal"); //cm.Move(new Vector3(vertical, 0, horizontal)); cm.Move(horizontal, vertical, headTracker); /*if(Input.GetAxis("Vertical")==0) * cm.Stop(); * if(Input.GetAxis("Vertical") >0) * cm.MoveFront(); * if(Input.GetAxis("Vertical") <0) * cm.MoveBack();*/ }
private void ChaseState() { float distance = Vector3.Distance(player.transform.position, transform.position); if (distance < 7f) { state = State.Attack; } else if (distance > 7f && distance < 16f) { characterMove.Move(Direction.Forward); } else if (Vector3.Distance(player.transform.position, transform.position) > 16f) { state = State.Idle; } }
void FixedUpdate() { // Move our character controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump); jump = false; }