How do you convert between built-in types?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By unaware
:warning: Old Version Published before Godot 3 was released.

Personally, I’m having trouble converting an integer into a string.

EDIT: I found out that you can use the str() function to convert an integer into a string, but the question still stands for other types.

:bust_in_silhouette: Reply From: Mohammad Hadi Aliakb

it’s just like str ,

int(something)
float(something)
bool(something)

Does this still work in Godot 3.1? I noticed Vector2(position) constructor causes an error · Issue #24001 · godotengine/godot · GitHub

Aaron Franke | 2019-08-25 17:57

Thanks :slight_smile:

(even though you weren’t answering it for me)

Merlin1846 | 2020-02-20 07:28

Also:

something as int
something as float
something as bool
something as RigidBody2D
something as RayCast2D

luislodosm | 2020-04-30 22:52

Missing String(...)

Ploppy | 2020-07-17 09:15