Collision glitch
mupcraft
Member Posts: 7
Hi Guys! I'm making a platform game (its a little rough around the edges at the minute and missing some frames of animation) and when my character collides with an enemy head on 70% of the time he changes to his "fallen on my butt" animation and stops as expected but the other 30% of the time he flickers between running and fallen animations for about half a second and the camera jolts.
I have included a video so that you can watch. please watch until the end because as previously stated, it took several attempts to replicate the bug.
Can anyone (without looking at the entire project) tell me why this occurring?
Thanks in advance for your help and sorry if this is in the wrong section.
Comments
It looked like the actor stopped colliding for a second which caused the image to revert back to the running animation. You should set a boolean attribute that says when the player collides with enemy change boolean "I collided" to true.
When "I collided" is true change to fallen animation.
When "I collided" is false change to running animation.
If this doesn't work can you post a screenshot of your rules?
I'm just guessing based on the information given.
Hi RabidParrot, I just tried it and the results are the same. I will post a screen of all my rules in my lunch break (I'm at work at the minute).
Not sure but it might be a layer related problem
I'll be taking my lunch in 30 minutes and posting all the rules I have for the player character then. Hopefully I can get this fixed as its one of two bugs I cant squish. Once I've fixed it all up I can polish it and make it look nicer haha.
ok here we go, heres allllll the rules I have for the player character. theres a lot.
http://postimg.org/image/fuip26feb/
Thanks for your help
Make sure you don't let the running animation occur if "i collided" is true.
Also you probably don't need to loop the fall animation. You probably just need a change image rule.
If "i collided" is false,
Allow running animation.
otherwise,
Change image to fall
Thank you, I think I will change the running code by adding a "Running" boolean so if "death, jump and fallen" are false running is true. if they are true running is false. Thank you for the advice. I really appreciate it. I'll let you know if it works.
Collision Glitch is a good name for a game.
its still doing it maybe I should start again?
Somewhere there is a conflict in your code that occurs during that event. Wow your code order is not refined. Remember code fires from top to bottom in an actor. You should move the camera control to the top of the stack. I haven't seen the conflict yet but I'll keep looking but that code order could be the issue.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@mupcraft Is the player below the enemy or is he above ? I really think its a layer problem , those glitches 80 % of the time happens when you collide and the enemy is above the Hero on the layers. It used to happen when I used to put my elevator actor above the hero actor. the animation glitches. But not 100 % sure , if its the same case here , but when it works 70 % of the time and glitches only a few times , it might be a layer problem.
Hi guys, I fixed it. and yeah, i need to arrange the code order. For some reason the "death start" boolean was casing this. I really dont know how.