Skip to content

LUA - FWeakObjectPtr setter / pass struct as Out parameter? #1179

@emoose

Description

@emoose

Branch or Release
experimental-latest

Game and Engine Version
Code Vein 2 UE5.4

Having some issues trying to call this game function:

void SetupInteractionInfo(FInteraction& OutInteraction, class AActor* InActor, class UInteractionComponent* InInteractionComponent, class UPrimitiveComponent* InOverlappedComponent);

Ideally I'd like the OutInteraction of this to be another objects playerInteractionComp.ReplicatedFocusedInteraction, but if I try passing that as the param directly, LUA gives an error about that not being a table:
Tried storing reference to a Lua table for an 'Out' parameter when calling a UFunction but no table was on the stack

If I do try using a LUA table and then copy it over onto playerInteractionComp.ReplicatedFocusedInteraction, I get a different error
[push_weakobjectproperty] Operation::Set is not supported

The FInteraction struct does have a FWeakObjectPtr inside it, in the docs there's only a get() method mentioned for that but no setter, guess that's where this error comes from (if I try setting the FWeakObjectPtr directly the same log error also appears)

Wondering if there's any other way to handle this, or if FWeakObjectPtr could have a setter added (though I'd guess there might be a reason it hasn't already..)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions