Disappearing Swords and weird bounce backs

slainester

New member
I followed the tutorial and have a fully functional version.
It's great! Can't wait to do my own thing.
I'm bothered by a few things though.
Why does the sword disappear when I hit enemies? It looks like the enemy is hit by an invisible force.(Could be cool in another game)
I tried a few things but I coudn't figure it out.

Also when the enemies are hit by the sword they sometimes bounce back in random directions.
I assume it's because they are randomly moving around and when you hit them it can happen that they bounce like this.
However shouldn't they rather bounce back in the opposite direction they where hit from?
It works correctly with the projectile weapon.

Other than that, I love the tutorial, as long as it is. I could follow everything and it made me try out stuff and understand a lot more how this works.
Thanks a lot.
Great Job!
 

chronosv2

New member
The sword disappears because it uses the same code as the projectile for collisions. As for why enemies are bouncing in random directions, could be because of the side the bounding box is hitting it on.
It was explained that the sword disappears because having separate hit code for the sword and projectile makes things unnecessarily complicated for what's intended to be a bare-bones introductory module.
 
Top Bottom