drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.26k stars 51 forks source link

Set linear_velocity.y to 0 when stop hovering to avoid pieces to fly away #174

Closed elmodor closed 1 year ago

elmodor commented 1 year ago

Fixes/Solves Fixes #166

When a piece is trying to reach its hovering position, but you let go off the mouse button, the linear_velocity is kept for future physic processes. This leads to the piece flying very very high (until it reaches HELL).

I set the linear_velocity in Y to 0 when we stop hovering. This fixes the issue. Tossing an object does not modify it's Y axis so it shouldn't break any other behavior.