void FixedUpdate() { ActorFixedUpdate(); UpdateMovementSpeed(); if (PlayerActorController != null) { PlayerTargetDistance = Vector3.Distance(PlayerActorController.GetTargetLocation(), transform.position); if (Controller != null) { MovementVector = Vector3.zero; if (PlayerTargetDistance < FollowDistance) { AkMovementTrigger movementTrigger = GetComponent <AkMovementTrigger>(); if (movementTrigger != null) { if (Time.time - PreviousMovementTriggerTime > MovementSoundLength) { movementTrigger.TriggerSound(); PreviousMovementTriggerTime = Time.time; } } UpdateLookRotation(); transform.rotation = LookRotation; Vector3 playerTargetPoint = PlayerActorController.GetTargetLocation(); MovementVector = (playerTargetPoint - transform.position).normalized; } Controller.Move((MovementVector + StaggerMovementVector) * MovementSpeed * Time.deltaTime); } } }
public void BackFeet() { AkMovementTrigger movementSound = GetComponent <AkMovementTrigger>(); if (movementSound != null) { movementSound.TriggerSound(); } }
public void Footstep() { AkMovementTrigger trigger = GetComponent <AkMovementTrigger>(); if (trigger != null) { trigger.TriggerSound(); } }