Next: Minion Module, Previous: Guard Module, Up: AI [Contents][Index]
This component should be placed on an empty object representing an AI. The object should have a 3D model of a unit parented to it. We also recommend adding a NavModule or similar, so it can get around, and some sort of AI ’brain’ such as a Guard or Minion Module. Make sure to set up all settings such as ray mask (so that it can’t shoot or hit through walls)
float
tgtYOffsetHow far above or below the target object’s origin should we look for the ’center’ of the object?
Default value: .5f
float
headingConeRadiusHow wide should the target cone be? We must be facing within this percentage of a 180 degree FOV of the target position + Tgt Y Offset to apply damage
Default value: .35f
string
attackAnimationTriggerTrigger in the Animator Controller on this object to be sent when the AI attacks
float
cooldownDurationCooldown duration
Default value: 1.0f
float
damageDelayHow long do we wait after starting the attack animation to actually apply the damage?
Default value: .5f
float
attackDamageDamage per hit
Default value: 10.0f
float
stunTimeIf greater than 0, will stun it’s target for this duration in seconds
Default value: 0
GameObject
damageRayOriginAn object representing a raycast where the damage starts. Should be an empty transform slightly in front of the character. Raycasts from this point to prevent damage through walls etc.
float
hitscanRangeRange of the attack
Default value: 2.3f
LayerMask
damageObstructionMaskWhat collision layers can block our attacks & vision?
float
huntingTimeOutHow long do we keep hunting our target after we can’t see them anymore?
Default value: 10
List<MessageManager.ManagedMessage>
attackMessagesMessages to send when damage is dealt
Default value: new List<MessageManager.ManagedMessage>()
List<MessageManager.ManagedMessage>
messagesToVictimMessages sent to the victim when damage is dealt
Default value: new List<MessageManager.ManagedMessage>()
List<MessageManager.ManagedMessage>
missMessagesMessages sent if we miss the target
Default value: new List<MessageManager.ManagedMessage>()
bool
debugSend messages to the console?
Default value: false
Targets the nearest object of a given tag
Argument: The tag of the object we wish to target
Causes the Hitscan Module to stop targeting anything.
float
tgtYOffsetHow far above or below the target object’s origin should we look for the ’center’ of the object?
Default value: .5f
float
headingConeRadiusHow wide should the target cone be? We must be facing within this percentage of a 180 degree FOV of the target position + Tgt Y Offset to apply damage
Default value: .35f
string
attackAnimationTriggerTrigger in the Animator Controller on this object to be sent when the AI attacks
float
cooldownDurationCooldown duration
Default value: 1.0f
float
damageDelayHow long do we wait after starting the attack animation to actually apply the damage?
Default value: .5f
float
attackDamageDamage per hit
Default value: 10.0f
float
stunTimeIf greater than 0, will stun it’s target for this duration in seconds
Default value: 0
GameObject
damageRayOriginAn object representing a raycast where the damage starts. Should be an empty transform slightly in front of the character. Raycasts from this point to prevent damage through walls etc.
float
hitscanRangeRange of the attack
Default value: 2.3f
LayerMask
damageObstructionMaskWhat collision layers can block our attacks & vision?
float
huntingTimeOutHow long do we keep hunting our target after we can’t see them anymore?
Default value: 10
List<MessageManager.ManagedMessage>
attackMessagesMessages to send when damage is dealt
Default value: new List<MessageManager.ManagedMessage>()
List<MessageManager.ManagedMessage>
messagesToVictimMessages sent to the victim when damage is dealt
Default value: new List<MessageManager.ManagedMessage>()
List<MessageManager.ManagedMessage>
missMessagesMessages sent if we miss the target
Default value: new List<MessageManager.ManagedMessage>()
bool
debugSend messages to the console?
Default value: false
Targets the nearest object of a given tag
Argument: The tag of the object we wish to target
Causes the Hitscan Module to stop targeting anything.
Next: Minion Module, Previous: Guard Module, Up: AI [Contents][Index]