Skip to main content
Version: Reality 4.27

OnChanged_Event Callback

OnChanged_Event Callback feature allows you to manipulate your code with “CustomEvent” when your variable is changed.

Conditions

  • Events name must start with “OnChanged_.
  • The variable you assigned must be Public
  • Event name and variable after the underscore symbol (_) must be the same
  • Events names are case-sensitive

Tutorial

  • Create a Blueprint Class and double-click on it. This action leads you to the Event Graph.

  • In the Event Graph, click on ADD COMPONENT button, and type ZD. This actin lists all ZD components. Select the ZD ACTOR component.

  • Select the ZD ACTOR from the Components tab
  • Go to the Variables section, and click + VARIABLE button

  • Add a BOOLEAN parameter, click on the 👁 to make it Public so it can be exposed to the Reality Hub Nodegraph

  • Go to the Event Graph canvas, right-click and type Add Custom Event

  • Your variable name must be the same name after “OnChanged_.” In this example, Custom Event’s name is “OnChanged_MyBoolean”

  • Drag and drop the variable into the Event Graph canvas, select the GET MYBOOLEAN

  • Right-click on the Event Graph canvas, type print screen, and select the Print Screen node under the Utilities > String.
  • Connect the OnChanged_MyBoolean node’s exec output pin to the Print String node’s exec input pin
  • Connect MyBoolean’s output pin to Print String’s In String input pin and click on the PLAY button

  • Switch to the Reality Hub user interface
  • Activate the Nodegrap/Actions module
  • Find and select the ZD ACTOR node