Hi all, sorry if this isn’t the right area of the forums, couldn’t find a simple Q&A section!
In short I’m planning a mobile game that would heavily focus on multiple physics-based objects being able to be broken by the player and react with the environment- think the classic smashing barrels/boxes into fragments thing here. As a Unity rookie, my question is essentially… is it possible? I’m just starting to learn Unity but I’m already worried drawcalls and such could be an issue (if I’m making the objects pre-fragmented etc) Any tips for how I could make something like this and what methods would be best?
Make 2 prefabs - a normal one and a broken one. Swap the normal out for the broken one when the player hits it and apply whatever physics you want to the broken one.
Cheers for the reply. To clarify I’m not so much asking literally how to break an object- I’m asking if a game focusing on physics-based breaking would be possible? As I said before I’m worried about the potential high amount of drawcalls. A lot of objects would be modular so I’m assuming I can atlas the textures to lower the costs- although I’m not 100% sure if you can atlas objects if you want them to act individually?
Well, technically, it should be withing the realm of possible.
As for what you could have to do, I’d say to simulate the damaging force as a sphere, and apply the forces and destruction to the objects intersecting with that sphere, potentially with a distance modifier.
Now, it’s far from perfect, because it would also harm items hidden behind others, and such, but I think it’s a decent place for a start.
After all, that’s also how explosion damages are done, those that take cover into account are mostly built uppon that sphere being shaped by the objects and their resistance values.
You only need to use physics objects if you want the fragments to react in a physical simulation. If you don’t need this, what about using a simple animation?