Skip to main content

Conversion and Text

When you need a conversion node​

Most of the time you do not. Numbers convert between themselves automatically, and nearly anything converts to text — connect a float output to a string input and it just works.

You need an explicit conversion in two cases:

  1. You have a Variant — a value whose type is not known ahead of time — and need a usable value out of it.
  2. You want to force a specific type, such as truncating a float to an int.

Variants turn up as array elements, blackboard values, and the output of anything that can return different types.

Variant_ConvertTo​

The important one.

TitleConvertTo {Type}
Execution inunnamed
Execution outSucceeded, Failed
Data inVariant — Variant, required
Data outResult — Any
PropertyType — the target type

This is the only conversion node that can fail visibly, which is why it branches. If the Variant does not hold something compatible, execution leaves through Failed and Result is not usable.

Wire Failed to a Warning while building a script — a silent wrong-type conversion is one of the harder things to spot.

The direct conversion nodes​

Eight nodes, all with the same shape: one unnamed required input of any type, one unnamed output of the target type, no execution pins.

NodeConverts to
ToBoolBool
ToByteByte
ToIntInt
ToInt64Int64
ToFloatFloat
ToDoubleDouble
ToStringString
ToVariantVariant

These convert silently. Narrowing a float to an int truncates rather than rounding.

There is no ToHashedString node

HashedString is the one type without a conversion node. Connect a String pin directly to a HashedString pin and the conversion happens implicitly.

String_Format​

Builds text from a pattern and a set of values.

TitleFormat {Text}
Executionnone
Data inText — String; Params — one pin per parameter you add
Data out"" — String
PropertiesText, Params

Write the pattern in the Text property using numbered placeholders, then add entries to Params — the node grows an input pin for each:

Text: Health: {0} / {1}
Params[0] -> current health
Params[1] -> max health

Any type can be plugged into a parameter pin; it is converted to text automatically.

This is what makes debug output readable. Paired with Draw3DText it gives you labelled values in the world, which is far easier to interpret than a bare number. See the raycast recipe.

See Also​