how to create a variable out of an enum?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Wurzelpilz
extends Node2D
   
enum Check {
	right,
	left,
	down,
	up
}

var my_enum : Check

that does not work: the identifier Check is not a valid type (not a script, or class)

:bust_in_silhouette: Reply From: sash-rc

Enum in GDScrpt is a kind of controversial right now and can’t be used as type, it works like namespaced const

enum Check {
    right,
    left,
    down,
    up
}
var my_enum : int = Check.right

But they’re planning to improve it in 4.0