Documentation 📖

Your guide to using FlowCanvas Visual Scripting in Unity

Connecting Assignable Types

As explained earlier, “value ports can only be connected to other value ports of the same or of assignable types”.

What this basically means, is that you are able to connect certain value type ports together even though they are not of the exact same type, if they can be converted or casted to that type. This is handled automatically for you and saves you a lot of time. In practice, if the editor allows you to connect 2 ports together then it means it’s possible and you have nothing more to worry about. When such a conversion is taking place, the connection will display an icon indicating the fact. In the following example, a float has been connected to a boolean. As a result, this conversion will result to false since the value is 0 (and true if the value was 1+).

ConnectionConvertion

For your convenience, here are the supported conversions by FlowCanvas and how they are done.

FromToThrough
Any PrimitiveAny Primitive.ConvertTo()
GameObjectAny Component.GetComponent
GameObjectTransform.transform
Any ComponentGameObject.gameObject
GameObjectVector3.transform.position
AnyComponentVector3.transform.position
A Child TypeBase Typeupcasting
A Base TypeChild Typedowncasting
AnythingString.ToString()

Custom Converters

You can also create custom converters from one type to another through code by subscribing to the ‘TypeConverter.customConverter’ event. Following is code on how to utilize this event as well as converting the Unity ‘Light’ type to a ‘float’ type by returning the Light.intensity for the shake of this example. Please note that this is an advanced topic.

Yes No
Last updated on February 19, 2023
Suggest Edit

© Paradox Notion 2015-2025. All rights reserved.