unreal.PawnSensingComponent

class unreal.PawnSensingComponent(outer=None, name='None')

Bases: unreal.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] Asset User Data: Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Auto Activate: Whether the component is activated at creation or must be explicitly activated.

  • can_ever_affect_navigation (bool): [Read-Write] Can Ever Affect Navigation: Whether this component can potentially influence navigation

  • component_tags (Array(Name)): [Read-Write] Component Tags: Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • editable_when_inherited (bool): [Read-Write] Editable when Inherited: True if this component can be modified when it was inherited from a parent actor class

  • enable_sensing_updates (bool): [Read-Write] Enable Sensing Updates: If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().

  • hear_noises (bool): [Read-Write] Hear Noises: 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] Hearing Max Sound Age: Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!

  • hearing_threshold (float): [Read-Write] Hearing Threshold: Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusion

  • is_editor_only (bool): [Read-Write] Is Editor Only: If true, the component will be excluded from non-editor builds

  • los_hearing_threshold (float): [Read-Write] LOSHearing Threshold: 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] On Component Activated: Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] On Component Deactivated: Called when the component has been deactivated

  • on_hear_noise (HearNoiseDelegate): [Read-Write] On Hear Noise: Delegate to execute when we hear a noise from a Pawn’s PawnNoiseEmitterComponent.

  • on_see_pawn (SeePawnDelegate): [Read-Write] On See Pawn: Delegate to execute when we see a Pawn.

  • only_sense_players (bool): [Read-Write] Only Sense Players: If true, will only sense player-controlled pawns in the world. Default: true

  • peripheral_vision_angle (float): [Read-Write] Peripheral Vision Angle: How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Primary Component Tick: Main tick function for the Component

  • replicates (bool): [Read-Write] Replicates: Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • see_pawns (bool): [Read-Write] See Pawns: If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true

  • sensing_interval (float): [Read-Write] Sensing Interval: 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] Sight Radius: Maximum sight distance.

property b_wants_see_player_notify

‘b_wants_see_player_notify’ was renamed to ‘see_pawns’.

Type

deprecated

property enable_sensing_updates

[Read-Only] Enable Sensing Updates: If true, component will perform sensing updates. At runtime change this using SetSensingUpdatesEnabled().

Type

(bool)

get_peripheral_vision_angle() float

Get Peripheral Vision Angle

Return type

float

get_peripheral_vision_cosine() float

Get Peripheral Vision Cosine

Return type

float

property hear_noises

[Read-Write] Hear Noises: 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.

Type

(bool)

property hearing_max_sound_age

[Read-Write] Hearing Max Sound Age: Max age of sounds we can hear. Should be greater than SensingInterval, or you might miss hearing some sounds!

Type

(float)

property hearing_threshold

[Read-Write] Hearing Threshold: Max distance at which a makenoise(1.0) loudness sound can be heard, regardless of occlusion

Type

(float)

property los_hearing_threshold

[Read-Write] LOSHearing Threshold: 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

[Read-Write] On Hear Noise: Delegate to execute when we hear a noise from a Pawn’s PawnNoiseEmitterComponent.

Type

(HearNoiseDelegate)

property on_see_pawn

[Read-Write] On See Pawn: Delegate to execute when we see a Pawn.

Type

(SeePawnDelegate)

property only_sense_players

[Read-Write] Only Sense Players: If true, will only sense player-controlled pawns in the world. Default: true

Type

(bool)

property peripheral_vision_angle

[Read-Only] Peripheral Vision Angle: How far to the side AI can see, in degrees. Use SetPeripheralVisionAngle to change the value at runtime.

Type

(float)

property see_pawns

[Read-Write] See Pawns: If true, we will perform visibility tests and will trigger notifications when a Pawn is visible. Default: true

Type

(bool)

property sensing_interval

[Read-Only] Sensing Interval: 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) –

property sight_counter_interval

‘sight_counter_interval’ was renamed to ‘sensing_interval’.

Type

deprecated

property sight_radius

[Read-Write] Sight Radius: Maximum sight distance.

Type

(float)