Hey everyone I’m new to babylon, this is my first post.
I’m considering building a board game engine within Babylon, similar to Table Top Simulator, but I’m running into some beginner problems:
https://www.babylonjs-playground.com/#8VV68R
I successfully implemented action managers, which i’m using to lift a checker off the board as its being dragged. Before this, I tried using events connected directly to the drag behavior, but the onDragObservable event only fires as the piece is being moved, resulting in a jerky motion where the piece jumps back to the board when the mouse is not moving. Using the onPickDownTrigger and onPickUpTrigger with actionmanager resolved this.
The problem is that I also would like to have a physics engine running, and that was made simple enough by Babylon. However, when I enable the physics engine, I seem to lose all behaviors connected to actionmanagers. You can enable physics in my playground example by uncommenting line 9 to observe this behavior.
At first I thought that it was related to the gravity being enabled and somehow counteracting the checker’s upward movement off the table, but eventually I tried setting the scene gravity to zero and I still had the same results. Regardless of gravity, and regardless of which physics engine i use, the actionmanager events dont seem to work anymore, regardless of which events I use.
The end goal is to have collision and gravity enabled, and also have dragging enabled, while maintaining control of the elevation of my checker off of the board. For example, when i drag my checker off the board now with physics enabled, I cannot prevent it from falling to the floor by forcing a change to its position.y value, even while i am still dragging the checker.
Any help would be appreaciated, and I just want to say that so far I’m realy enjoying babylon. I think I made the right decision, and I hope someone can help me to get actionmanager events working alongside physics. Thanks!