I could only imagine all the creative ways that this can be used in future playcanvas projects. If you have a good enough computer! By the way, great job on the environment, it looks fantastic.
You know what would save some performance and optimize that script a bit. You could make it so that after the object breaks, a timer starts, and after a certain amount of time, all the fragments disappear. By doing this the GPU will have an easier time running the project since it doesn’t have to always be rendering the fragments that are on the ground.
Thanks, guys Yes, as I mentioned in Discord, there are many ways to optimize this. I was happy to ignore most of the optimizations for this was supposed to be an example
Perhaps, I could make another pass on it and add optimizations, if there is interest. Or someone could do it as well, as it is easy to fork projects.
One optimiation, as @DinoCalebProductions mentioned, could be on the debris. The fragments colliders don’t need to live forever, and could have relatively short life. The visual mesh can stay - there is no performance issue, as the fragments are batched. One could simply disable rigidbody and collision components on the fragments to remove them from the physics simulation. Or use a better physics engine