components.find

Finds a component owned by an actor.

Top-level alias: ue.get_component.

Syntax

ue.components.find(actor: ActorReference, name: string) -> UObjectProxy?, string?
ue.get_component(actor: ActorReference, name: string) -> UObjectProxy?, string?

Parameters

ParameterTypeDescription
actorActorReferenceActor proxy, string query, or actor descriptor.
namestringComponent object or reflected property name. Matching is case-insensitive and supports substrings.

Returns

TypeDescription
UObjectProxyThe matching UActorComponent.
nil, stringThe actor or component was not found.

Example

local character = assert(ue.get_player_character())
local movement = assert(ue.components.find(character, "CharacterMovement"))

print(movement.MaxWalkSpeed)

Runtime-created components are searched in addition to components exposed by reflected actor properties.

On this page