How guys,
I’m trying to set up a simple explosion that not only stuns and throws the player about (have simple 3D animation as my head has no arms - so can’t ragdoll, lol). However I want the same explosion to be able to blow out lights, blow doors in and the like.
FYI it’s a simple 2.5D game, so for placeholder stuff I’m just removed doors/windows renderers and playing a particle system to simulate debris.
My question is this…
I haven’t used SendMessage yet, but from what I’m read on these forums it seems to be rather overhead intensive. My other option is to check each object, then check it’s tag, type and find the relevant script for the right types of object. This will be quite code intensive (the amount of code that is, imagine it’s just a lot of the same with different references in if’s).
Which would be better to use? I will using a raycast to make sure that nothing it comes into contact with isn’t on another floor (don’t want that, lol).
Also would I have to have an receiving Function in each objects script? For Example
// this object does not actually respond to 'Boom'
public void Boom()
{
return;
}