void OnTriggerStay(Collider other) { AIStateMachine machine = GameSceneManager.instance.GetAIStateMachine(other.GetInstanceID()); if (machine != null && _controller != null) { _controller.DoStickiness(); machine.VisualThreat.Set(AITargetType.Visual_Player, _controller.characterController, _controller.transform.position, Vector3.Distance(machine.transform.position, _controller.transform.position)); machine.SetStateOverride(AIStateType.Attack); } }
// Update is called once per frame private void OnTriggerStay(Collider col) { AIStateMachine machine = GameSceneManager.Instance.GetAIStateMachine(col.GetInstanceID()); if (machine != null && controller != null) { controller.DoStickiness(); machine.visualThreat.Set(AITargetType.VisualPlayer, controller.CharacterController, controller.transform.position, Vector3.Distance(machine.transform.position, controller.transform.position)); machine.SetStateOverride(AIStateType.Attack); } }
void OnControllerColliderHit(ControllerColliderHit hit) { AIStateMachine machine = GameSceneManager.instance.GetAIStateMachine(hit.collider.GetInstanceID()); if (machine != null) { _dragMultiplier = 1 - _npcStickiness; machine.VisualThreat.Set( AITargetType.Visual_Player, _characterController, transform.position, (hit.transform.position - transform.position).magnitude); machine.SetStateOverride(AIStateType.Attack); } }
void OnTriggerStay(Collider col) { // Is this collier a zombie AIStateMachine machine = GameSceneManager.instance.GetAIStateMachine(col.GetInstanceID()); if (machine != null && _controller != null) { // Apply stickiness _controller.DoStickiness(); // Set THIS location as the zombie's visual threat machine.VisualThreat.Set(AITargetType.Visual_Player, _controller.characterController, _controller.transform.position, Vector3.Distance(machine.transform.position, _controller.transform.position) ); // Force the zombie in ATTACK state machine.SetStateOverride(AIStateType.Attack); } }