unreal.PawnSensingComponent
¶
- class unreal.PawnSensingComponent(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
ActorComponent
SensingComponent encapsulates sensory (ie sight and hearing) settings and functionality for an Actor, allowing the actor to see/hear Pawns in the world. It does nothing on network clients.
C++ Source:
Module: AIModule
File: PawnSensingComponent.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.editable_when_inherited
(bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor classenable_sensing_updates
(bool): [Read-Write] If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().hear_noises
(bool): [Read-Write] If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default: true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.hearing_max_sound_age
(float): [Read-Write] Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!hearing_threshold
(float): [Read-Write] Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusionis_editor_only
(bool): [Read-Write] If true, the component will be excluded from non-editor buildslos_hearing_threshold
(float): [Read-Write] Max distance at which a makenoise(1.0) loudness sound can be heard if unoccluded (LOSHearingThreshold should be > HearingThreshold)on_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_hear_noise
(HearNoiseDelegate): [Read-Write] Delegate to execute when we hear a noise from a Pawn’s PawnNoiseEmitterComponent.on_see_pawn
(SeePawnDelegate): [Read-Write] Delegate to execute when we see a Pawn.only_sense_players
(bool): [Read-Write] If true, will only sense player-controlled pawns in the world. Default: trueperipheral_vision_angle
(float): [Read-Write] How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.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!see_pawns
(bool): [Read-Write] If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: truesensing_interval
(float): [Read-Write] Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.sight_radius
(float): [Read-Write] Maximum sight distance.
- property b_wants_see_player_notify: bool¶
‘b_wants_see_player_notify’ was renamed to ‘see_pawns’.
- Type:
deprecated
- property enable_sensing_updates: bool¶
[Read-Only] If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().
- Type:
(bool)
- property hear_noises: bool¶
true IMPORTANT NOTE: If we can see pawns (bSeePawns is true), and the pawn is visible, noise notifications are not triggered.
- Type:
(bool)
- Type:
[Read-Write] If true, we will perform audibility tests and will be notified when a Pawn makes a noise that can be heard. Default
- property hearing_max_sound_age: float¶
[Read-Write] Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!
- Type:
(float)
- property hearing_threshold: float¶
[Read-Write] Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusion
- Type:
(float)
- property los_hearing_threshold: float¶
[Read-Write] Max distance at which a makenoise(1.0) loudness sound can be heard if unoccluded (LOSHearingThreshold should be > HearingThreshold)
- Type:
(float)
- property on_hear_noise: HearNoiseDelegate¶
[Read-Write] Delegate to execute when we hear a noise from a Pawn’s PawnNoiseEmitterComponent.
- Type:
(HearNoiseDelegate)
- property on_see_pawn: SeePawnDelegate¶
[Read-Write] Delegate to execute when we see a Pawn.
- Type:
(SeePawnDelegate)
- property only_sense_players: bool¶
true
- Type:
(bool)
- Type:
[Read-Write] If true, will only sense player-controlled pawns in the world. Default
- property peripheral_vision_angle: float¶
[Read-Only] How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.
- Type:
(float)
- property see_pawns: bool¶
true
- Type:
(bool)
- Type:
[Read-Write] If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default
- property sensing_interval: float¶
[Read-Only] Amount of time between pawn sensing updates. Use SetSensingInterval() to adjust this at runtime. A value <= 0 prevents any updates.
- Type:
(float)
- set_peripheral_vision_angle(new_peripheral_vision_angle) None ¶
Sets PeripheralVisionAngle. Calculates PeripheralVisionCosine from PeripheralVisionAngle
- Parameters:
new_peripheral_vision_angle (float) –
- set_sensing_interval(new_sensing_interval) None ¶
Changes the SensingInterval. If we are currently waiting for an interval, this can either extend or shorten that interval. A value <= 0 prevents any updates.
- Parameters:
new_sensing_interval (float) –
- set_sensing_updates_enabled(enabled) None ¶
Enables or disables sensing updates. The timer is reset in either case.
- Parameters:
enabled (bool) –