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.27k stars 55 forks source link

Bug: Container resets object zoom/height #123

Closed elmodor closed 1 year ago

elmodor commented 1 year ago

Describe the bug When pulling out an objects (token) from a container (the Purse from the default pack) results in the objects zoom/height resetting to default. Furthermore the height of the object being pulled out is higher than the container. So it is impossible to put the object back into the container unless the object is lowered again.

To Reproduce Steps to reproduce the behavior:

  1. assets/TabletopClub/tokens/cube contains a cube with scale = Vector3( 1.5, 0.5, 1.5 )
  2. In game, load the Purse container, add a few tokens to the container
  3. Pull a token from the container, use the scrollwheel to lower it and put it on the table
  4. Pull another token from the container. The token is height up again.
  5. Try to put the object back into the Purse without lowering it. Not possible.

Expected behavior The object zoom/height (set by scrollwheel) is not reset when pulling out objects from a container.

Screenshots token_container.webm

Environment Arch Linux

Version v0.1.0 Beta 1

Additional context This could maybe also be solved via scripting later on? That you are able to script the object height when they leave the container?

drwhut commented 1 year ago

This is by design - it prevents the object from touching the container again when it exits.

I can reopen this issue if there is enough demand to keep the previous height, I'll also discuss it with playtesters.

elmodor commented 1 year ago

I was afraid so. However, isn't there a different event for enter/exiting? Maybe it could prevent adding the object again to the same container in the first second when it is spawned.

My problem is that when you change the zoom/height and then move objects around it stays the same. But whenever you take an object from a container you have to set the zoom/height again - every time you take a new object. This can be a bit annoying if you take out tokens a lot ...

drwhut commented 1 year ago

That's an interesting point, to be fair. I'll discuss it with others first, then I'll get back to you with a more informed opinion.