I have a fractutred wall. And a script, if i shoot the Wall with a sphere, that it adds a Rigidbody to the tile where the collision was at.
But the Problem is, that the other tiles are floating in the air. This looks ugly.
So how can i detect if theres free space under these tiles, and then add a rigidbody?
add a rigidbody to ALL the tiles from the start. Why add them later?
the wall would become very unstable if you did that.
I would use raycasts at the extents to determine if there is anything directly under the brick
Raycasting would be an excellent idea! Except, I think adding components during runtime is going to take a lot of processing power (im not sure about that). Why don’t you combine both your ideas! You could add rigidbodies to all of them BUT put rigidbody.sleep on all of them. Then cast a ray and if nothing is there, wake up the rigidbody.
Here’s some links to help you out