public override void UpdateAbility(CharacterStateBase characterStateBase, Animator animator, AnimatorStateInfo stateInfo) { AliController control = characterStateBase.GetBotController(animator); if (control.MoveRight && control.MoveLeft) { control.transform.rotation = Quaternion.Euler(0f, 180f, 0f); animator.SetBool("IsRunning", false); return; } if (!control.MoveRight && !control.MoveLeft) { control.transform.rotation = Quaternion.Euler(0f, 180f, 0f); animator.SetBool("IsRunning", false); return; } if (control.MoveRight) { /* DONT NEED TO SWITCH TO RUN (THIS IS RUN SCRIPT), JUST MOVE */ control.transform.Translate(Vector3.forward * Speed * Time.deltaTime); control.transform.rotation = Quaternion.Euler(0f, 90f, 0f); //animator.SetBool("IsRunning", true); } if (control.MoveLeft) { /* DONT NEED TO SWITCH TO RUN (THIS IS RUN SCRIPT), JUST MOVE */ control.transform.Translate(Vector3.forward * Speed * Time.deltaTime); control.transform.rotation = Quaternion.Euler(0f, -90f, 0f); //animator.SetBool("IsRunning", true); } }
public override void UpdateAbility(CharacterStateBase characterStateBase, Animator animator, AnimatorStateInfo stateInfo) { AliController ali = characterStateBase.GetBotController(animator); if (IsGrounded(ali)) { animator.SetBool("IsGrounded", true); } else { animator.SetBool("IsGrounded", false); } }
public override void UpdateAbility(CharacterStateBase characterStateBase, Animator animator, AnimatorStateInfo stateInfo) { AliController control = characterStateBase.GetBotController(animator); if (control.Jump) { animator.SetBool("IsJumping", true); //This is where you left off } if (control.MoveRight) { animator.SetBool("IsRunning", true); } if (control.MoveLeft) { animator.SetBool("IsRunning", true); } }
public override void OnEnter(CharacterStateBase characterState, Animator animator, AnimatorStateInfo stateInfo) { characterState.GetBotController(animator).RIGID_BODY.AddForce(Vector3.up * JumpForce); }