Creating logic in a 3D world can get messy, which is why it's helpful to place the logic inside containers. To add logic to a container, you can simply select all the logic nodes you want to add, and tap 'Containerize' on the Bottom Toolbar.
It's also a good idea to name the container, so it's clear what the logic inside the container does.
There are four differenct container types which change how the logic inside is used.
Plain containers are helpful when you want to group nodes and objects, and control their visibility in the world.
This container type doesn't change how the logic works.
Behaviors are used to apply and expand the logic in an already existing object. For example, player characters usually have multiple behaviors like "Player Movement" and "Player Health."
Behavior container requires an object that acts as a stand-in for the object the behavior is applied to. HypeHype premades, for example, make use of the puzzle piece asset.
Reusables are used when you want to create multipe object instances that share the same logic. Like Behaviors, reusables also require at least one object.
Reusable instances can be added to the scene from the Build Menu, or by using a spawner.
If you want to create logic that is shared, or called from multipe places, then you can set the container type to Function Source and use the Function Caller node to call it. You also need to create inputs and outputs.
Function Source needs to have a name for it to be visible in the Function Caller node.
To learn more, see Functions.
Containers can have custom inputs and outputs. Behaviors and Reusables show these on objects that are added to the scene.
For Function Source, the inputs and outputs are in the Function Caller node.
To add inputs and outputs, select the container and tap the plus icon. Inputs come in on the left, while outputs are on the right. Tapping on the plus icon will show a list of possible data types.
containers_addinputsandoutputs.mp4
To edit inputs and outputs, select the container and open the details panel. All inputs and outputs can be found in the Advanced tab. To edit them, tap on the Edit Inputs/Outputs
button.