Teufelauto / 2D6D-Dice

Dice Roller for 2D6 Dungeon
MIT License
0 stars 0 forks source link

Building angular momentum #11

Closed Teufelauto closed 1 week ago

Teufelauto commented 2 weeks ago

Major bug in Physics engine.

A dice instance seems to accumulate angular momentum with each throw, spinning clockwise on the z-axis. then, it seems to wobble and not come to rest as quickly as it once did. Gets worse each throw.

Current functional workaround is to return to Title Page and press Play button again, after every few throws. Throwing a die repeatedly will cause it to defy physics after 6-10 throws.

Suspect code workaround will be required, by destroying, then creating new instance each throw to reset. First throw is great. Throw 10 is silly, with it spinning to the right.

Teufelauto commented 1 week ago

Right. So... The spinning direction is due to the values I used for spinning defines it as such. The accumulating angular momentum does not happen in new versions of Rapier Physics, but I can't get the dice to stop wiggling with the new version. The dice will not come to rest. They just keep wiggling.

Teufelauto commented 1 week ago

Got new version to stop wiggling and throw somewhat ok in testing through manipulating settings, but cannot get the dice to return to the home position. I do not know why clicking 'pick up' doesn't work. Fatigue die won't roll, either.

Meanwhile, in the old physics, reinstantiating is going to take some effort due to having signals connected in the main scene instead of each child.

Teufelauto commented 1 week ago

Fixed by #13 Instancing of dice.