SonicWorldsNext
SonicWorldsNext copied to clipboard
Bouncing Mechanics are frequently off
Big example is if I do a big drop and hit an enemy, I sometimes just kill it and then immediately land. I'll be investigating this behavior soon.
Clearing assignment from myself as I haven't had much time to actively contribute lately. Hoping to resume working on new gimmicks soon though.
I fixed this problem in my own project by modifying the code in EnemyBase.gd by changing this code at line 19:
if (i.movement.y < 0 or i.global_position.y-(i.velocity.y*delta) > global_position.y):
to:
if (i.movement.y < 0):
The second test in the if statement seems to return true in inappropriate circumstances, which causes the problem of the player sometimes simply landing after destroying an enemy. It also just seems unnecessary to me; is there ever a situation where you wouldn't want the player to bounce if they had downwards velocity? I cut this second test out and bouncing works perfectly.
This is just for enemies; monitors have their own problems, and the way I fixed them in my project is a little hacky, but I think it works fine. If you like, I can make a PR for this.
This should be completely fixed by now. Worked on it a couple weeks back and found some inaccurate math and a faulty elif statement to be the cause.
Since this issue hasn't been mentioned in a while and we've made steps to address it, I'm going to mark this issue as fixed. I've had no more issues with many attempts.