Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huff and Puff attack appears to do no damage #5

Closed
ribbybibby opened this issue Dec 26, 2014 · 2 comments
Closed

Huff and Puff attack appears to do no damage #5

ribbybibby opened this issue Dec 26, 2014 · 2 comments
Labels

Comments

@ribbybibby
Copy link
Owner

I'm fairly sure the H'n'P attack does no damage. Need to look into why this is and fix it.

@ribbybibby ribbybibby added the bug label Dec 26, 2014
@ribbybibby
Copy link
Owner Author

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:

  1. 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).
  2. Make the prefabs colliders, switch to OnCollisionEnter2D (not preferable).

Gonna try number 1 first.

@ribbybibby
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant