NPC Attack
This component belongs to the following package:
- com.yahaha.sdk.npc
This NPC Attack Component configures the non-player character's (NPC) attack behavior.
Property | Description |
---|---|
Is Debug | If enabled, the Component runs in debug mode, providing additional information for testing and troubleshooting purposes in the console. |
Attack Interval | Determines the minimum time gap in seconds between consecutive attacks performed by the NPC. It helps regulate the timing and frequency of NPC attacks. Minumum value: 0. Default: 0.5. |
Speed Multiplier | A multiplier to the base movement speed of the NPC during the attack behavior. A value of 1 represents the normal speed, while values greater than 1 increase the speed, and values less than 1 decrease the speed. Default: 2. |
Events and Actions
Events
- MissingTargetFromNPCAttack: Triggered when the NPC loses its target.
- EventArgs
- Npc: The NPC's behavior.
- EventArgs
- AttackActionPerform: Triggered when the specific action is performed when attacking.
- EventArgs
- Npc: The NPC's behavior.
- EventArgs
- AttackStart: Triggered when the attack behavior starts.
- EventArgs
- Npc: The NPC's behavior.
- EventArgs
- AttackEnd: Triggered when the attack behavior ends.
- EventArgs
- Npc: The NPC's behavior.
- EventArgs
Actions
- ChangeBehaviour: Switches to the attack behavior.
- Arguments
- npcGameObject: The NPC's GameObject.
- Arguments
- SetEnable: Sets whether the attack behavior is enabled or not.
- Arguments
- enable: Indicates whether to enable the attack behavior.
- Arguments