Material Box

Material Box

WEB Design & Material Images

Godot - Branch multiple values at once in match statement

Godot

GDScript code example to branch multiple values at once in match statement.


In GDScript match statement, can specify multiple values to match by separating with commas.

var stage = 5

match stage:
	1, 2, 3:
		print("1 or 2 or 3")
	4, 5, 6:
		print("4 or 5 or 6")
	_:
		print("No Match")

Godot

TitleGodot - Branch multiple values at once in match statement

CategoryGodot

Created

Update

AuthorYousuke.U