I have been building a game prototype that has destructible buildings spread across a large city environment. The problem I am having is writing the script for the smaller parts of the building, that when destroyed will subtract from the buildings over all health. When the over all health reaches zero it is replaced with a model that has a collapsing animation.
My question is does anyone have any ideas on how I can write a script that takes damage done to an object and when it reaches zero it swaps out the object for a particle effect and then sends a value or function command to the script that controls the buildings base structure so that it will subtract from the whole of the building health and cause it to fall down into a pile of rubble that has been pre-animated?
I have objects that take damage and swap out for a particle effect leaving a big open hole in the wall it’s just getting all of those removed objects to subtract from the larger structure so it will fall when enough parts destroyed.
Any Ideas?
Thanks