You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot has a concept called Variant::booleanize where any Variant type can be applied in a boolean operator condition to determine whether or not it evaluates to true or false. This can be useful in graphs to minimize the number of nodes needed to test specific conditions.
There is a few caveats, such as types like the Vector, Projection, Quaternion, and others have what is called a baseline representation of their internal indexed/keyed components that represent a false condition. For example, Vector2, Vector3, and Vector4 all will return false when their internal x, y, z, and w fields equal 0. Similarly when Projection, Quaternion, and others internally represent their "Identity" or default value when using Projection() or Quaternion(), this too represents false.
Implementation ideas
Adjust OScriptNodePin::can_accept to always allow connecting to BOOL input pins.
The text was updated successfully, but these errors were encountered:
Description
Godot has a concept called
Variant::booleanize
where any Variant type can be applied in a boolean operator condition to determine whether or not it evaluates to true or false. This can be useful in graphs to minimize the number of nodes needed to test specific conditions.There is a few caveats, such as types like the Vector, Projection, Quaternion, and others have what is called a baseline representation of their internal indexed/keyed components that represent a
false
condition. For example,Vector2
,Vector3
, andVector4
all will return false when their internal x, y, z, and w fields equal0
. Similarly when Projection, Quaternion, and others internally represent their "Identity" or default value when usingProjection()
orQuaternion()
, this too representsfalse
.Implementation ideas
Adjust
OScriptNodePin::can_accept
to always allow connecting toBOOL
input pins.The text was updated successfully, but these errors were encountered: