- Home /
Other
How to make a Block chek if it´s floating?
Sorry for my bad english =)
I´ve made a Block buidling script and everything works fine. But the next thing i want to (and don´t know how to realise) ist how to let them check if they are floatong.
Block = []
Simple tower:
[] [] []
[]
[] <--- If i destroy this block, all others above are floating.
I want to to let them know if there are floating or not and if they are they shall replace themself to another object(Block, This one will have a rigidbody). Do you undestand what i mean? I dont want a ready script. Just a main idea how to do that or maybe a tutorial in that direction.
Answer by wilco64256 · Sep 16, 2012 at 05:00 PM
You could raycast down from a block and see if it hits another block within a particular minimum distance depending on how big they are, and if it doesn't then it's floating.
Yes, but the blocks right next to another block would fall. But they shall only fall if they arent connected with the ground.
I'm a touch confused by your comment. Do you actually want the blocks to the side to fall as well?