Search code examples
eventspropertiesunreal-engine4mrtk

Unreal Engine 4.27 How can I expose a property to be seen in an Event Graph?


I am currently working on an application for the Hololens and want to program a button that changes the lighting intensity. I am having trouble finding/referencing this property shown below in my event graph. How can I expose this property to make it editable via a custom event?

The directional light from MRTK. I want to reference the Intensity property. The directional light from MRTK. I want to reference the Intensity property.

My button event graph.

My button event graph.


Solution

  • The property you want to access from a blueprint must be BlueprintReadWrite.

    So in the header of your class you have to declare the class member like this:

    UPROPERTY(BlueprintReadWrite)
    float Intensity = 0.0f;
    

    Then in your blueprint you want to drag-off a pin from the return value of Get Actor Of Class and you should be able to get and set the value of your variable.