Hi,
I’m trying to have a script control when and how an explosive missile explodes. It looks, on collision, for a SphereOverlay of colliders and then looks at the tag of each of them, to see if they have to be damaged, so it can make a sendMessage to each of the targets.
The problem is that I want both some enemies AND my main character to shoot this type of missile. So I don’t know what’s better:
-
OPTION A) Inherit from a central explosionMissile and each of the sons of the inheritance would check for the corresponding tag (“enemy” or “player”)
-
OPTION B) Have the same class for both but set a parameter on instantiation (can it be done) and this parameter wouuld be the String of the tag, so it checks differently each time.