Hi everyone,
I have been working on getting this to work in real time. I think I made a solid prototype - in terms of punching a hole through a wall. Was surprisingly tough to get right! I wasted hours on getting this to work with proper physics rules:
- all sorts of permutations of bricks/collider masses,frictions/restitutions,
- constraints
- disposing constraints on collision
- explosions, forces, impulses
Nothing really worked or looked nice.
Anyway, the idea now is to spawn the destructible parts of the wall in STATIC mode. Then shoot a ray at it. At the point of impact have a probe sphere ready of the size of the hole and see which of the dest. parts intersect. Make these DYNAMIC and spawn an explosion. After a small timeout you make the remaining parts DYNAMIC and spawn a black hole a bit behind the wall which (should) ensure/s that the wall properly collpases. Make sure the ground has high friction.
Some notes:
- Playground controls: Left mouse mark target, right mouse fire
- If possible, use thin instances.
- Definitely spawn display meshes by default. Replace on demand.
- Values are probably not portable. I needed to change delay and force in my local project.
Best wishes
Joe