I’m currently prototyping a fruit-slicer-like game.
I’m only planning to integrate a simple hit / no-hit mechanic (no direction of cut / custom cut).
What would be a simple strategy to detect this “swipe over / through” on 3d-Objects ?
I can remember an old babylon.js example, where an actual line was created and then checked for collision, but maybe there is a simpler way.
So, if you don’t want to go all the way creating custom line meshes you can use a raycast.
If the game is taking place on the XY plane, then convert your touch input in world points at the same Z distance from the camera as the fruit objects and do a raycast from start to end, or for better accuracy multiple ones that follow the touch gesture.
You can check that way if there was a hit with an object.
The 2d version also makes a lot of sense (reminds me of my old flash-stuff).
I will check If I need Ammo for the basic-gameplay, and then will see which of your workflows works best for me. Thanks again for your time!