Crates on platformers?

Hi. I want to apply the crate smashing in my game, like any other platformer, crates are the ones you need to attack so you can get the coins. Kind of like, jak and dazter, crash bandicoot, ratchet and clank. I know that there are many ways to do this. But i just want to know the most proper way of doing so that someone who knows could share their idea. My main idea is, when the crates is in collision with attack, it will connect to an actuator that’s “end object”, and will “add object”. The object added will be the crates pieces. But i realized that it would be too ugly when there are multiple crates and if they are smashed, the pieces would fly the same way. So does anyone knows an almost perfect way of doing this?

I would go with your idea. I would try to do a few diffrent animations with the smashing or whatsoever and would then play the smashing animations randomly.

So the added Object, the Pieces, would be a single Mesh playing an Animation? Maybe it would be enough if you would apply a random-valued Rotation (on X, Y & Z) to that Object, just for once – so the Pieces would at least seem to fly into random Directions.

If instead you would add several Meshes for the several Pieces, then the Moving Velocity might be randomized.

Of Course, for proper Use of the Random Module, you will have to use a simple Script.

EDIT:


from bge import logic as g
import random
 
angle=random.uniform(0,5)
g.getCurrentController().owner.applyRotation((angle,angle,angle),True)

That MIGHT do the Job but I have not tested it.