Closed eilx closed 6 months ago
Using a closure is totally possible. Just make sure that the property name matches what you call in the guard expression. E.g.
state_chart.set_expression_property('test_fn', func(): return value)
# Guard Expression
test_fn.call()
If you just want to access a property of the current object you can also set the full object as an expression property, e.g.
var value = false
func _ready():
state_chart.set_expression_property("me", self)
and then use this expression in your guard:
me.value
Would there be any issues using a closure for a guard expression? This feels odd to me and likely unnecessary to do, but perhaps I'm overthinking it.
Apologies if this is the wrong place for this.