My second pack (well, third) just went on its way to asset store. This one is a bit more complex, featuring a breakable objects system. Enjoy the videos : )
Executable (windows) - a scene with a lot of crates and no image effects;
Executable (windows) - the full scene with crates, pallets, shed and barrels; I messed around with the player script variables so don’t move too much : )
I have a problem with the fps player script (sometimes it just jumps in the air) and could be from one of these reasons:
I messed up the fps script variables (unlikely, as I did that before in other scenes)
there are way too many rigidbodies with mesh collider (though set on convex mode, still) - literally hundreds of physics objects that don’t ‘sleep’ immediately (could be set up from script I think). In a real game scenario this is unlikely going to happen unless you really want this many objects in your level for some story reason.
The bouncing issue - when instantiating the wreck prefab, this one’s made of several pieces with collision and rigidbody components and therefore will immediately ‘explode’ - shoot it’s parts away from the center of the prefab. Also, the crates’ mass is very small, so the pieces. I left it like that simply to showcase that indeed all parts get blown away and obtain a bit of a visual effect. A physics material setup for these objects along with a proper mass will fix this.
And yes, you can walk on what you just destroyed, only right now the player can’t move regardless the amount of debris around (or lack of thereof).
the jump issue iv had before on URT2 engine, found it was just cpu calculation to slow to recognize actual movement, so it calculates the impact when intersecting thus is 1000000 times stronger than should it should be, no idea how to fix it, i used less objects and stuff to prevent player intersections on heavy debry areas but thats level editing not scripting. I guess some ray trace predictions might work, or a simplified collision mesh when the fracture is triggered maybe?
The jump issue was something funny (fixed now); The temporary muzzle flash I used for the gun (a plane created in unity editor) had collision mesh component.
The pack is now live in Unity asset store. Check it out in the Asset Store in your Unity editor! I’d like to say thanks to Caitlyn from Unity for the patience and assistance : )