Skip to content

Graph Functions

JasonJonesLASM edited this page Jun 29, 2021 · 5 revisions

We have the ability to directly reference machines like classes, but graphs don't have functions built into their declaration. We can get around this by combining a Sub Graph/Super Unit, a Delegate, and the ability to reference machines as instances.

Simply create a graph variable. Any name is fine. It's beneficial to give some sort of indicator it's for a function, not a variable, we'll use an asterisk. The variables will always be null prior to entering Play Mode, so don't set the type.

Place an On Enable into Once and set the function variable to the Delegate Value Output port. This will allow for an easy setup phase, that only occurs one time.

The first time a value is retrieved from this port, it is initialized, setting up the wrapper instance. Therefore we must do this in the graph. That's it.

You will end up with variables that act like class functions.

THIS ENTRY IS UNDER CONSTRUCTION

Clone this wiki locally