0 votes

Nowhere in docs, nowhere in editor help. I am trying to find type 17.

Godot version godot 3.2 stable
in Engine by (5,136 points)

1 Answer

0 votes
Best answer

It allows you to determine what a variable is so if you use typeof() with a variable from an array for example you can find out if it is an integer or something else.

by (1,373 points)
selected by

Found this in the documentation here
https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html#match

Variable pattern

Matches the contents of a variable/enum:


match typeof(x):
    TYPE_REAL:
        print("float")
    TYPE_STRING:
        print("text")
    TYPE_ARRAY:
        print("array")

There are just 3 examples od enum I was looking for, but that actually helped, I could find the rest by typing TYPE_. Link in Godot editor help is misleading. Thanks :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.