You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found the reason for this. Inside the HuffNPuff script the SendMessage procs OnTriggerEnter2D and the colliders on the HnP prefabs are set as Triggers, however the actual enemy colliders are not triggers.
Two solutions:
Attach a trigger to the Enemy prefabs, keep the HnP script more or less how it is (preferable). This could be expanded to make all attacks triggers (neater).
Make the prefabs colliders, switch to OnCollisionEnter2D (not preferable).
We were also checking that the object we collided with was called 'Enemy' before applying damage, this didn't work because none of our objects are called 'Enemy' any more. We now apply damage based on layer (the Enemy layer is 11).
Bite suffered from the above problem too. I'll remain vigilant for other attacks that don't work for the same reason.
I've implemented the first solution, adding triggers to all the enemy types. Bug fixed and closed.
I'm fairly sure the H'n'P attack does no damage. Need to look into why this is and fix it.
The text was updated successfully, but these errors were encountered: