Skip to content

UAndromedaCarryComponent

Kind: class Source: Source/Andromeda/Player/AndromedaCarryComponent.h Base classes: USceneComponent

Details

Player-owned component that tracks the held actor and routes pickup/release through carry capabilities.

Protected Properties

Member Type Summary
HeldActor TObjectPtr< AActor > Transient carried AActor implementing IAndromedaCarryableInterface.
HeldItemRelativeLocation FVector Relative offset applied when attaching an object to the carry component.
HeldItemRelativeRotation FRotator Relative rotation applied when attaching an object to the carry component.

Public Methods

Member Type Summary
UAndromedaCarryComponent function Disables ticking because carrying changes only on explicit pickup and placement commands.
GetHeldActor AActor * Returns the actor currently attached to the carry component.
IsCarryingItem bool Returns whether a held actor is currently assigned.
CanPickUpTarget bool Validates whether a focused actor can enter carried state for the supplied pawn.
TryPickUpTarget bool Attempts to carry a focused actor.
TryPlaceHeldItemAtTransform bool Releases the held actor at a world transform and clears carry state.

Members

HeldActor

TObjectPtr< AActor > HeldActor

Transient carried AActor implementing IAndromedaCarryableInterface.

HeldItemRelativeLocation

FVector HeldItemRelativeLocation

Relative offset applied when attaching an object to the carry component.

HeldItemRelativeRotation

FRotator HeldItemRelativeRotation

Relative rotation applied when attaching an object to the carry component.

UAndromedaCarryComponent

UAndromedaCarryComponent::UAndromedaCarryComponent()

Disables ticking because carrying changes only on explicit pickup and placement commands.

GetHeldActor

AActor * UAndromedaCarryComponent::GetHeldActor() const

Returns the actor currently attached to the carry component.

Returns:

Held AActor implementing IAndromedaCarryableInterface, or nullptr when nothing is carried.

IsCarryingItem

bool UAndromedaCarryComponent::IsCarryingItem() const

Returns whether a held actor is currently assigned.

This is the semantic guard for GetHeldActor returning non-null. Keep this method tied directly to the HeldActor state; subclasses should not hide it with different behaviour.

Returns:

True when HeldActor is non-null.

CanPickUpTarget

bool UAndromedaCarryComponent::CanPickUpTarget(UObject *PickupTarget, APawn *CarryingPawn) const

Validates whether a focused actor can enter carried state for the supplied pawn.

The target must be an actor implementing IAndromedaCarryableInterface and pass CanBeCarried.

Parameters:

Name Type Description
PickupTarget UObject * Focused object that may be carried.
CarryingPawn APawn * Pawn requesting the pickup.

Returns:

True when TryPickUpTarget may carry the target actor.

TryPickUpTarget

bool UAndromedaCarryComponent::TryPickUpTarget(UObject *PickupTarget, APawn *CarryingPawn)

Attempts to carry a focused actor.

Parameters:

Name Type Description
PickupTarget UObject * Focused object that may be carried.
CarryingPawn APawn * Pawn requesting the pickup.

Returns:

True when the carryable actor was accepted and attached.

TryPlaceHeldItemAtTransform

bool UAndromedaCarryComponent::TryPlaceHeldItemAtTransform(const FTransform &TargetTransform)

Releases the held actor at a world transform and clears carry state.

Returns false when no valid carryable actor is held. On success, HeldActor is cleared before SetReleasedPhysicalState is called on the released object.

Parameters:

Name Type Description
TargetTransform const FTransform & World transform where the item should be released.

Returns:

True when a held actor was released.