unreal.AIPerceptionComponent
¶
- class unreal.AIPerceptionComponent(outer=None, name='None')¶
Bases:
unreal.ActorComponent
AIPerceptionComponent is used to register as stimuli listener in AIPerceptionSystem and gathers registered stimuli. UpdatePerception is called when component gets new stimuli (batched)
C++ Source:
Module: AIModule
File: AIPerceptionComponent.h
Editor Properties: (see get_editor_property/set_editor_property)
asset_user_data
(Array(AssetUserData)): [Read-Write] Array of user data stored with the componentauto_activate
(bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.can_ever_affect_navigation
(bool): [Read-Write] Whether this component can potentially influence navigationcomponent_tags
(Array(Name)): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.dominant_sense
(type(Class)): [Read-Write] Indicated sense that takes precedence over other senses when determining sensed actor’s location.Should be set to one of the senses configured in SensesConfig, or None.
editable_when_inherited
(bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor classis_editor_only
(bool): [Read-Write] If true, the component will be excluded from non-editor buildson_component_activated
(ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reseton_component_deactivated
(ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivatedon_perception_updated
(PerceptionUpdatedDelegate): [Read-Write] Might want to move these to special “BP_AIPerceptionComponent”on_target_perception_info_updated
(ActorPerceptionInfoUpdatedDelegate): [Read-Write] Notifies all bound objects that perception info has been updated for a given target. The notification is broadcasted for any received stimulus or on change of state according to the stimulus configuration.Note - This delegate will be called even if source actor is no longer valid by the time a stimulus gets processed so it is better to use source id for bookkeeping.
on_target_perception_updated
(ActorPerceptionUpdatedDelegate): [Read-Write] Notifies all bound objects that perception info has been updated for a given target. The notification is broadcasted for any received stimulus or on change of state according to the stimulus configuration.Note - This delegate will not be called if source actor is no longer valid by the time a stimulus gets processed. Use OnTargetPerceptionInfoUpdated providing a source id to handle those cases.
primary_component_tick
(ActorComponentTickFunction): [Read-Write] Main tick function for the Componentreplicates
(bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!senses_config
(Array(AISenseConfig)): [Read-Write] Senses Config
- forget_all() → None¶
basically cleans up PerceptualData, resulting in loss of all previous perception
- get_actors_perception(actor) → ActorPerceptionBlueprintInfo or None¶
Retrieves whatever has been sensed about given actor
- Parameters
actor (Actor) –
- Returns
info (ActorPerceptionBlueprintInfo):
- Return type
- get_currently_perceived_actors(sense_to_use)¶
If SenseToUse is none all actors currently perceived in any way will get fetched
- get_known_perceived_actors(sense_to_use)¶
If SenseToUse is none all actors ever perceived in any way (and not forgotten yet) will get fetched
- get_perceived_actors(sense_to_use)¶
Get Perceived Actors
- get_perceived_hostile_actors()¶
blueprint interface
- get_perceived_hostile_actors_by_sense(sense_to_use)¶
Get Perceived Hostile Actors by Sense
- property on_perception_updated¶
[Read-Write] Might want to move these to special “BP_AIPerceptionComponent”
- Type
- property on_target_perception_info_updated¶
[Read-Write] Notifies all bound objects that perception info has been updated for a given target. The notification is broadcasted for any received stimulus or on change of state according to the stimulus configuration.
Note - This delegate will be called even if source actor is no longer valid by the time a stimulus gets processed so it is better to use source id for bookkeeping.
- property on_target_perception_updated¶
[Read-Write] Notifies all bound objects that perception info has been updated for a given target. The notification is broadcasted for any received stimulus or on change of state according to the stimulus configuration.
Note - This delegate will not be called if source actor is no longer valid by the time a stimulus gets processed. Use OnTargetPerceptionInfoUpdated providing a source id to handle those cases.