How to Expose TObjectPtr Functions to Blueprints?

Doctor_Kannon
Mon, 17 Nov 2025 03:39:59 +0000
Programming & Scripting

I’m trying to expose the InputTriggers ChordAction through set/get functions. To do this I need to cast the TObjectPtr to a regular pointer (and vice-versa).

InputTriggers.h

Class: UInputTrigger

(line 409) public:

// The action that must be triggering for this trigger's action to trigger
UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Category = "Trigger Settings", meta = (DisplayThumbnail = "false"))
TObjectPtr<const UInputAction> ChordAction = nullptr;

UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Trigger Settings")
UInputAction* getChordActionValueCppFn() const override { return UChordAction::ChordAction.Get(); }

UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Trigger Settings")
bool setChordActionValueCppFn(const UInputAction* ChordActionInput) const override { UChordAction::ChordAction = (TObjectPtr<const UInputAction>) ChordActionInput; }

After build and editor compilation, these functions are not accessible in blueprints. Does anyone know why?

1 post - 1 participant