Material Box

Material Box

WEB Design & Material Images

Godot - Remove Values from the Beginning or End of an Array

Godot

GDScript code examples to remove values from the beginning or end of an array.


In GDScript, you can use pop_front() to remove the value at the beginning of an array.
pop_front() directly modifies the specified array.
If the array is empty, no action is taken.

var array = ["apple", "lemon", "banana"]
array.pop_front()

print(array)
# ["lemon", "banana"]

In GDScript, you can use pop_back() to remove the value at the end of an array.
pop_back() directly modifies the specified array.
If the array is empty, no action is taken.

var array = ["apple", "lemon", "banana"]
array.pop_back()

print(array)
# ["apple", "lemon"]

Godot

TitleGodot - Remove Values from the Beginning or End of an Array

CategoryGodot

Created

Update

AuthorYousuke.U