Right click inside the assets panel and select Assets->Create Flowgraph
Double click the flowgraph asset.
The flowgraph editor will start.
Initially, newly created flowgraph files contain several events pre-defined in the graph.
Is triggered whenever the AR Experiecne is Played on a mobile device / Simulated through the editor.
Is triggered for every rendered frame.
Events are the entry point for flow graphs as the execution of actions can only be triggered by them.
The white circle on the right side of the node is an "execution socket" and can be connected an action, which will be executed whenever the event is triggered.
Every node in the system has one or more sockets.
Sockets are used to connect nodes for the following reasons:
- Execution sockets: Attach the next node in a flow.
- Input / Output sockets: Get a value / Set a value in nodes.
Sockets can be connected by dragging and dropping from one output socket to one input socket and vice-versa.
Nodes connected by it form a flow.
Each node is executed in turn.
Actions such as "Set Local Position" and "Look At" are called one after another until the last node in the chain (flow) is executed.
It is used to reference an object in the scene.
Input object sockets can also be initialized with a selected object.
By clicking the "Select object" button you can define the object used as input.
Transforms are used to control and manipulate the object's position, rotation and scale.
Input vector sockets can also be initialized with x, y and z values.
Panning by dragging the right mouse button
Selecting nodes by dragging the left mouse button
Moving nodes by dragging them
Deselecting by clicking the background
Zooming in and out by using the scroll-wheel
- Create a new project, select the Image target template.
- In the Nodes section, expand the Transform category and drag & drop the Rotate node.
- Connect the "On Update" event's output execution socket to the Rotate's input execution socket.
- Press on the Transform input socket within the Rotate node and drag outside, then release. The flowgraph editor will show you node suggestions that are suitable for this socket. Select "Get Transform".
The Get transform node requires an object input, leave this object blank (aka "select object").
This will cause the Get transform node to reference the object which this flowgraph component will be assigned to.
- In the Nodes section, expand the Math category and drag & drop the Multiply node.
- Connect the "Delta Time" number output from "On Update" to the "A" number input on "Multiply".
- Set "B" on "Multiply" to 30 and connect the "Result" number output to "Degrees" within "Rotate".
- Edit the "Axis" on the "Rotate" node, set "Y" to 1.
- Set "Space" to "self".
This will cause our object to rotate 30 degrees per second on its local Y axis
Select any cube.
Click Add Component in the Object Details panel and select the flowgraph component.
Click "Add Existing Flowgraph" and assign the flowgraph asset you've previously created.
Hit Play in the AR Studio to see the cube spinning.
Since we've made a generic flowgraph that rotates the object that references it - We're able to repeat this step and assign the same flowgraph asset to all the other cubes in the scene (Add flowgraph component etc..).
This will result in all the cubes spinning when the AR experience is played.
Updated about 3 years ago