1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-25 17:44:24 +00:00
hella-farm/behaviours/sampler_random.gd

15 lines
235 B
GDScript3
Raw Normal View History

2024-04-16 03:08:25 +00:00
extends Sampler
class_name SamplerRandom
## Sample a random reference from the array.
@export var possibilities: Array = []
func sample() -> Object:
if len(possibilities) == 0:
return null
return Random.sample(possibilities)