- We have both the cracked and the un-cracked version of the plane already in the scene at start, when switching we enable one and disable the other.
- Each shard already have a rigidbody and a mesh-collider from the start now, the mesh collider is set to convex, and the rigidbody kinematic is set to true for all shards (to keep the shards from falling down by themselves).
- We have created an invisible trigger box that checks for the projectile that covers the whole original pane instead of a script on each shard. It functions the same as the previous shard script; it takes the position of the projectile and finds all shards around it by using Physics.OverlapSphere, and then sets the rigidbody kinematic to false for all of the shards. This improves calculation times a lot compared to our earlier implementation!
We also made the pane thinner by scaling down the un-cracked pane and the shards in the x-axis.

Inga kommentarer:
Skicka en kommentar