Unity Visual Scripting
Last updated
Last updated
Starting with Unity6 and realvirtual 6 we removed Visual Scripting. It is replaced by Unity Behavior Graph.
Starting with realvirtual.io Professional 2021, we have added support for Unity Visual Scripting.
You can find out more about Unity Visual Scripting here in the Unity documentation https://docs.unity3d.com/Packages/com.unity.visualscripting@1.6/manual/index.html.
Unity’s Visual Scripting is a visual approach to programming. You can even track the status of the script during simulation. However, compared to the realvirtual.io LogicSteps alternative and to Playmaker, Unity Visual Scritping is less “step chain” oriented.
Unity Visual Scripting is an optional package and must be installed via the Unity Package Manager. You can search for “Visual Scripting” and you will find the latest package. Press “Install” to install the package.
After Unity Visual Scripting is installed you need to set the compiler define. Please go to "Edit > ProjectSettings > Player > Other Settings". There you will find a section "Script Compilation - Scripting Define Symbols". Please add there "REALVIRTUAL_VISUALSCRIPTING"
Now you will need to regenerate the visual scripting nodes by going to "Edit > ProjectSettings > VisualScripting". Please select "Regenerate Nodes"
After you regenerated the Nodes also the realvirtual.io Nodes are available and you can start using visual scripting.
With a click of the right mouse button on the graph you can select game4Automation and add a realvirtual.io. Currently there are 5 special nodes.
All nodes have an event entry port on the left side. This port must be connected to an event sender node in order for the node’s logic to execute.
This node sets the speed of the selected drive. The output event port is always executed once the input event port is set.
Drive State reads the status of the selected drive and passes it on to the output ports.
Sets the drive to move to a specified destination when the start port receives an event. To be informed about the arrived status, you have to execute the update input event port continuously, e.g. by the Fixed Update event.
Reads or writes a bool signal.
Is reading the state of the sensor as soon as the Start port is getting an event.
There are a variety of default unity nodes. Please refer to the Unity documentation for all the default nodes.
You can also create your own nodes. The best start is to check the source code of the provided realvirtual.io nodes.
© 2022 in2Sight GmbH https://realvirtual.io - All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including printing, saving, photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher.