gd-YAFSM icon indicating copy to clipboard operation
gd-YAFSM copied to clipboard

Reference variables directly from the parent of StateMachine

Open sairam4123 opened this issue 3 years ago • 3 comments

Hi, I'd be happy if we could reference variables directly from the parent, instead of setting the variable separately, we could have the current option as well, when we have to reference from children of the parent.

I hope you understand it, and I know the difficulty of the implementation, but it would be a nice feature to have.

sairam4123 avatar May 17 '21 07:05 sairam4123

Do you mean like what you can do with AnimationTree:

anim_tree.set("parameters/eye_blend/blend_amount", 1.0)
# Simpler alternative form:
anim_tree["parameters/eye_blend/blend_amount"] = 1.0

imjp94 avatar May 17 '21 08:05 imjp94

No not like that, well, directly referencing the variable, like getting the variable directly instead of setting the variable.

	$StateMachinePlayer.set_param("speed", speed)

instead of this, the variable could be directly fetched from the parent, so instead of setting the variable here, the state machine will fetch the variable directly and we could reference the variable in the editor.

https://i.imgur.com/MzIvmoJ.png Here, it will a menu option, where you could select the variable.

sairam4123 avatar May 17 '21 08:05 sairam4123

A menu that popup when typing variable name, so you can choose from the list?

Can do that, but I am leaving all the UI/UX improvement for v1.0 update, so it gonna take some time.

imjp94 avatar May 17 '21 09:05 imjp94