unreal.ActorComponent
¶
- class unreal.ActorComponent(outer: Optional[Object] = None, name: Union[Name, str] = 'None')¶
Bases:
Object
ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors. ActorComponents that have a transform are known as SceneComponents and those that can be rendered are PrimitiveComponents. see: [ActorComponent](https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Actors/Components/index.html#actorcomponents) see: USceneComponent see: UPrimitiveComponent
C++ Source:
Module: Engine
File: ActorComponent.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 componentauto_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 navigationcomponent_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 classis_editor_only
(bool): [Read-Write] Is Editor Only: If true, the component will be excluded from non-editor buildson_component_activated
(ActorComponentActivatedSignature): [Read-Write] On Component Activated: Called when the component has been activated, with parameter indicating if it was from a reseton_component_deactivated
(ActorComponentDeactivateSignature): [Read-Write] On Component Deactivated: Called when the component has been deactivatedprimary_component_tick
(ActorComponentTickFunction): [Read-Write] Primary Component Tick: Main tick function for the Componentreplicate_using_registered_sub_object_list
(bool): [Read-Write] Replicate Using Registered Sub Object List: 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] Replicates: Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!
- acquire_editor_element_handle(allow_create=True) ScriptTypedElementHandle ¶
K2 Acquire Editor Component Element Handle
- Parameters:
allow_create (bool) –
- Return type:
- activate(reset=False) None ¶
Activates the SceneComponent, should be overridden by native child classes.
- Parameters:
reset (bool) – Whether the activation should happen even if ShouldActivate returns false.
- add_tick_prerequisite_actor(prerequisite_actor) None ¶
Make this component tick after PrerequisiteActor
- Parameters:
prerequisite_actor (Actor) –
- add_tick_prerequisite_component(prerequisite_component) None ¶
Make this component tick after PrerequisiteComponent.
- Parameters:
prerequisite_component (ActorComponent) –
- property auto_activate: bool¶
[Read-Only] Auto Activate: Whether the component is activated at creation or must be explicitly activated.
- Type:
(bool)
- property 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.
- destroy_component(object) None ¶
Unregister and mark for pending kill a component. This may not be used to destroy a component that is owned by an actor unless the owning actor is calling the function.
- Parameters:
object (Object) –
- get_component_tick_interval() float ¶
Returns the tick interval for this component’s primary tick function, which is the frequency in seconds at which it will be executed
- Return type:
- get_owner() Actor ¶
Follow the Outer chain to get the AActor that ‘Owns’ this component
- Return type:
- is_active() bool ¶
Returns whether the component is active or not
- Returns:
The active state of the component.
- Return type:
- is_being_destroyed() bool ¶
Returns whether the component is in the process of being destroyed.
- Return type:
- is_component_tick_enabled() bool ¶
Returns whether this component has tick enabled or not
- Return type:
- property is_editor_only: bool¶
[Read-Only] Is Editor Only: If true, the component will be excluded from non-editor builds
- Type:
(bool)
- property 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
- Type:
- property on_component_deactivated: ActorComponentDeactivateSignature¶
[Read-Write] On Component Deactivated: Called when the component has been deactivated
- receive_async_physics_tick(delta_seconds, sim_seconds) None ¶
Event called every async physics tick if bAsyncPhysicsTickEnabled is true
- receive_begin_play() None ¶
Blueprint implementable event for when the component is beginning play, called before its owning actor’s BeginPlay or when the component is dynamically created if the Actor has already BegunPlay.
- receive_end_play(end_play_reason) None ¶
Blueprint implementable event for when the component ends play, generally via destruction or its Actor’s EndPlay.
- Parameters:
end_play_reason (EndPlayReason) –
- receive_initialize_component() None ¶
deprecated: ‘receive_initialize_component’ was renamed to ‘receive_begin_play’.
- receive_tick(delta_seconds) None ¶
Event called every frame if tick is enabled
- Parameters:
delta_seconds (float) –
- receive_uninitialize_component(end_play_reason: EndPlayReason) None ¶
deprecated: ‘receive_uninitialize_component’ was renamed to ‘receive_end_play’.
- remove_tick_prerequisite_actor(prerequisite_actor) None ¶
Remove tick dependency on PrerequisiteActor.
- Parameters:
prerequisite_actor (Actor) –
- remove_tick_prerequisite_component(prerequisite_component) None ¶
Remove tick dependency on PrerequisiteComponent.
- Parameters:
prerequisite_component (ActorComponent) –
- property replicate_using_registered_sub_object_list: bool¶
[Read-Only] Replicate Using Registered Sub Object List: 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.
- Type:
(bool)
- property replicates: bool¶
[Read-Only] Replicates: Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!
- Type:
(bool)
- set_auto_activate(new_auto_activate) None ¶
Sets whether the component should be auto activate or not. Only safe during construction scripts.
- Parameters:
new_auto_activate (bool) – The new auto activate state of the component
- set_component_tick_enabled(enabled) None ¶
Set this component’s tick functions to be enabled or disabled. Only has an effect if the function is registered
- Parameters:
enabled (bool) – Whether it should be enabled or not
- set_component_tick_interval(tick_interval) None ¶
Sets the tick interval for this component’s primary tick function. Does not enable the tick interval. Takes effect on next tick.
- Parameters:
tick_interval (float) – The duration between ticks for this component’s primary tick function
- set_component_tick_interval_and_cooldown(tick_interval) None ¶
Sets the tick interval for this component’s primary tick function. Does not enable the tick interval. Takes effect imediately.
- Parameters:
tick_interval (float) – The duration between ticks for this component’s primary tick function
- set_is_replicated(should_replicate) None ¶
Enable or disable replication. This is the equivalent of RemoteRole for actors (only a bool is required for components)
- Parameters:
should_replicate (bool) –
- set_tick_group(new_tick_group) None ¶
Changes the ticking group for this component
- Parameters:
new_tick_group (TickingGroup) –