unreal.AIPerceptionComponent
¶
- class unreal.AIPerceptionComponent(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
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_forgotten
(ActorPerceptionForgetUpdatedDelegate): [Read-Write] Notifies all bound delegates that the perception info has been forgotten for a given target. The notification get broadcast when all stimuli of a given target expire. Note that this functionality requires the the actor forgetting must be enabled via AIPerceptionSystem.bForgetStaleActors.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 Componentreplicate_using_registered_sub_object_list
(bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.replicates
(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]
- 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:
ActorPerceptionBlueprintInfo or None
- get_currently_perceived_actors(sense_to_use) Array[Actor] ¶
If SenseToUse is none all actors currently perceived in any way will get fetched
- get_known_perceived_actors(sense_to_use) Array[Actor] ¶
If SenseToUse is none all actors ever perceived in any way (and not forgotten yet) will get fetched
- get_perceived_hostile_actors_by_sense(sense_to_use) Array[Actor] ¶
Get Perceived Hostile Actors by Sense
- property on_perception_updated: PerceptionUpdatedDelegate¶
[Read-Write] Might want to move these to special “BP_AIPerceptionComponent”
- Type:
- property on_target_perception_forgotten: ActorPerceptionForgetUpdatedDelegate¶
[Read-Write] Notifies all bound delegates that the perception info has been forgotten for a given target. The notification get broadcast when all stimuli of a given target expire. Note that this functionality requires the the actor forgetting must be enabled via AIPerceptionSystem.bForgetStaleActors.
- property 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.
- property 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.
- Type: