ULimenSnapAnchorComponent
Overview
ULimenSnapAnchorComponent is a custom component derived from UArrowComponent. It provides functionality for attaching actors to anchor points, managing the attachment state, and broadcasting events when anchors are added or removed. This component can be spawned in Blueprints and used to control the positioning and attachment of actors within the game world.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| TargetAnchorId | EditAnywhere, BlueprintReadWrite, Category = "Anchor" | The ID of the target anchor point. |
| AnchorTargetActor | EditAnywhere, Category = "Debug" | The actor to which the component will attempt to attach when using debug functions. |
| bAttach | EditAnywhere, Category = "Debug" | Whether to attach the owner to the anchor point during debugging. |
| CurrentAnchor | BlueprintReadOnly, meta=(AllowPrivateAccess=true) | The current anchor point that the component is attached to. |
Functions
Return Type | Signature | Description |
|---|---|---|
| GetAnchorByTargetId(const AActor* InActor, const FName& TargetId) | Retrieves a |
| AnchorTo(ULimenAnchorPointComponent* InTarget, bool bAttachToAnchor = true) | Anchors the component to the specified anchor point. |
| AnchorToActor(AActor* InTarget, FName AnchorId, bool bAttachToAnchor = true) | Anchors the component to an actor's anchor point with the given ID. |
| RemoveCurrentAnchor(bool bDetachFromAnchor = true) | Removes the current anchor from the component. |
| GetTargetAnchorId() const | Returns the target anchor ID of the component. |
| GetCurrentAnchor() const | Retrieves the current anchor point that the component is attached to. |
Usage & Implementation Notes
Threading Constraints: This component does not have any specific threading constraints.
Replication Requirements: None.
Memory Lifetime Management: The component uses
TWeakObjectPtrfor managing weak references to actors and components, which helps in avoiding memory leaks by automatically invalidating pointers when the objects are destroyed.Initialization Dependencies: The component initializes its properties through the constructor.