S
StanleyG
Guest
Hello,
Im making a kinda basic side scrolling platformer, where you can also attack enemies and stuff.
But I have a weird problem, this is my code (see image) for attacking. Basically whenever I press attack key, it creates an object next to my character which dissapears after few moments, the object_attack has collision with object_monster and inside that collision is code other.hp-=1. Object_attack is set to "sensor".
But for some reason if I stand next to object_monster and attack it while we are standing both still, it does nothing. It only damages/kills it if its moving while colliding with object_attack. That also goes vice versa, when object_monster attacks me while im standing still and its also standing still, it doesnt damage me.
Any workaround around this? I have no idea what to do.
Thank you for your time.
Im making a kinda basic side scrolling platformer, where you can also attack enemies and stuff.
But I have a weird problem, this is my code (see image) for attacking. Basically whenever I press attack key, it creates an object next to my character which dissapears after few moments, the object_attack has collision with object_monster and inside that collision is code other.hp-=1. Object_attack is set to "sensor".
But for some reason if I stand next to object_monster and attack it while we are standing both still, it does nothing. It only damages/kills it if its moving while colliding with object_attack. That also goes vice versa, when object_monster attacks me while im standing still and its also standing still, it doesnt damage me.
Any workaround around this? I have no idea what to do.
Thank you for your time.
Attachments
-
2.6 KB Views: 8