Melee animation make game glitch

Tyasu

  • Posts: 3
Hello ive been trying to make a behavior for a melee attack for a while and it was giving me an error so I changed the first if statement and the error went away and the game starts(screenshot attached). When I run into the actor it starts to freeze my game until I pull away. What am I doing wrong and if any1 has a better way for an animation switch/attack on collision pls help. Tnx  :)

im not exactly sure  but try turning continuous collisions off. for the actors

or maybe you need a boolean to set the collision to false for a brief duration then set it to true. kinda like a hit stun for the player. just guessing

It might not be causing the issue you're having, but I don't think you really need that first "if". The event itself is already detecting collisions with the player and having the condition detect for just any actor could definitely raise problems for you in the long run.

Try making a break as therealistone suggested, or possibly a knock-back effect. If you have a health system working with it then you won't just have freezing to worry about, it would also mean instant death.

Tyasu

  • Posts: 3
Tnx setting the collisions to not always on worked perfectly.Now the enemy character attacks on collision but I cant get him to stop attacking and for some reason everyone can walk through walls '~' any suggestions?

Tyasu

  • Posts: 3
It might not be causing the issue you're having, but I don't think you really need that first "if". The event itself is already detecting collisions with the player and having the condition detect for just any actor could definitely raise problems for you in the long run.

Try making a break as therealistone suggested, or possibly a knock-back effect. If you have a health system working with it then you won't just have freezing to worry about, it would also mean instant death.


If I take the first if statement out and leave the first If statement as "If-hit on left" Stencyl highlights it as red and gives me an error for something being undefined.