I am currently attempting to program a mobile air hockey game, but I’ve been having some difficulty with a seemingly basic part of the physics portion. So far, I have a static-configured striker object, which is moved by a touch/drag method, and a kinetic-configured puck object. Initially, the puck would hardly move at all after the striker hit it, and then would stop registering the collision altogether. That, at least, I was able to handle by opening the physics debugger and determining that the puck was simply sleeping and for whatever reason would not wake up during collisions, which I (possibly unwisely?) fixed by disabling sleeping for the puck.
Now, however, I’m struggling with a different problem: the striker isn’t delivering any force to the puck. No matter how hard I hit it, or how high I set the bounce settings, the puck is simply pushed along by the striker, maintaining contact with it, and as soon as I stop moving the striker (or move away from the puck), the puck stops moving, and stays where it was last touched.
I am fairly certain this is a result of the drag method failing to account for/ provide a change in velocity, so while the striker is “moving,” all that is really changing is the position of the striker, and thus any collision between the striker and puck doesn’t actually have any force in it. However, I am unsure how to remedy this, although I’m sure it’s probably something simple I’m just overlooking. Any suggestions/ examples? I can include the relevant code if necessary, but I’d need to go copy it from my other computer.
*Edited for clarity