Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
133 stars 2 forks source link

Snapper Events Node #997

Open gameboycjp opened 8 months ago

gameboycjp commented 8 months ago

Is your feature request related to a problem? Please describe.

Currently, it's a bit complex to find out when an object snaps or unsnaps from a snapper, especially from a snappable object itself. It would probably simplify things greatly to have a dedicated node that pulses on snap events.

Describe the solution you'd like

A Snapper Events node that has a pulse for OnSnap and OnUnsnap, most likely would be the best option.

Describe alternatives you've considered

It is possible to detect without a dedicated node, but it's hard to do, especially when trying to detect from the snappable object itself.

Additional Context

No response

Banane9 commented 8 months ago

It is possible to detect without a dedicated node, but it's hard to do, especially when trying to detect from the snappable object itself.

I wouldn't say you can 100% detect it - without specific setup you can make a good guess, but not actually be certain. The setup I usually use to check if an item is "equipped" for example just goes by has active user and is not being held.

As such, I would very much support the addition of such nodes, though I would add "Is Snapped" as another option, providing a bool stating whether a Snapper has been snapped to a matching Snap Target and not been (re)moved.

lxw404 commented 8 months ago

I think this is one of the situations where ParentValue and ParentValueLink are essential, and it gets around the usual issues of has active user and held since you can just set a meaningful default for when it's not parented.

I do agree there should be another method built in for snapping detection though.

Zyzyl commented 8 months ago

If this were added, I'd make the case for nodes tracking snap events from the SnapTarget side as well. I can imagine cases where it makes more sense to track whether something snaps to the SnapTarget, rather than subscribing to events on Snappers instead.

Banane9 commented 8 months ago

I can imagine cases where it makes more sense to track whether something snaps to the SnapTarget, rather than subscribing to events on Snappers instead.

Definitely agreed, would be nice if it'd work with the same nodes even, perhaps 🤔