You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate more of my internal plugins to actions. Often I find that "just add a component" as an API misses subtleties, like running pathfinding calculations more than is necessary, or failing to zero out the velocity and then watching my enemies scurry into the middle of nowhere when pathfinding fails to find a path. But I'm finding that the semantics around pressed/released and values are a bit unclear. In particular:
Are there situations where it makes sense for an axis to be pressed and have a zero value vs. unpressed with a zero value? What about pressed/unpressed with None?
Likewise, are there situations where it makes sense for an axis to be released and have a value? Or released with a zero value vs. None?
I have a NavigationAction::Move action which translates gamepad axis motions to either SetLinearVelocity or Translate based on the presence of various components. But I'm unsure what the source of truth for the action being set/enabled should be. Should SetLinearVelocity just check for a value and pass that onto the component? Or should it check pressed/released state first and conditionally clear the component if released? If it's invalid for an axis to be released with a non-zero value, or released with any value not None, it might be useful to either assert or document that.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to migrate more of my internal plugins to actions. Often I find that "just add a component" as an API misses subtleties, like running pathfinding calculations more than is necessary, or failing to zero out the velocity and then watching my enemies scurry into the middle of nowhere when pathfinding fails to find a path. But I'm finding that the semantics around pressed/released and values are a bit unclear. In particular:
None
?None
?I have a
NavigationAction::Move
action which translates gamepad axis motions to eitherSetLinearVelocity
orTranslate
based on the presence of various components. But I'm unsure what the source of truth for the action being set/enabled should be. ShouldSetLinearVelocity
just check for a value and pass that onto the component? Or should it check pressed/released state first and conditionally clear the component if released? If it's invalid for an axis to be released with a non-zero value, or released with any value notNone
, it might be useful to either assert or document that.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions