Adding health to an object
A health system, or hit points as it’s known in the gaming world, is a way to determine how many projectile impacts a virtual object can withstand before it’s destroyed. This is the perfect way to implement our destruction system because we want to be able to set a building’s destruction to something high and a rock’s destruction to something low. Having this variability while also keeping it simple is ideal for a health system within a virtual world, especially since you don’t want to waste too much time on this implementation when you have other things you want to do with the experience.
In this section, we will cover how to add health points to an object and then add damage points to our projectiles. The interplay of these two elements gives us a robust damage and health system that allows us to lay the foundation for how our objects are destroyed in our VR scene.
Adding health points
To add health points to...