I’ve just starting using the Defold engine, so my apologies for the basic question.
I want to program a pinball game, and so far I can easily make a ball that is a dynamic object that properly collides and recoils from static objects. To make the flippers, I thought to create them as kinematic objects, and animate them to move (or rotate) upon a button press. When I do this, the ball is properly pushed by the flipper when they are colliding, but no momentum is given to the ball, ie. it stops moving as soon as it is not touching the flipper. How can I properly code this flipper? Thanks.
No. Kinematic objects report collisions but everything else is left in the hands of the developer. Dynamic objects on the other hand leaves everything to the physics engine (and you could probably create the flipper from a joint+collision shape).
I’ve got another question regarding the same problem. I’ve successfully implemented a ball and flippers (using joints), but there is the problem that my ball will pass through the flipper if it is moving too fast. I imagine this is because the speed is too high, and it moves through the flipper’s collision box in between frames. Is there any way to fix this, other than decreasing speed or increasing the size of the collision box?
In box2d - physics engine inside defold, you can set parameter “bullet” that prevents dynamic bodies from passing through each other. Sadly this setting is not exposed in defold and you can’t use it.
However I’ve made my own paid box2d extension where you can set this parameter. If you are interested. It’s still not finished, working on it.