Page 2 of 2

Re: yet another collision question thread.

Posted: Mon Apr 21, 2014 11:58 pm
by tehryanx
Thanks for having a look :) A few followup questions.

First, are you sure this is the case? The reason I'm asking is because when I collide with the ceiling just jumping straight up into it my yvel is set to 0 and I immediately fall.

Second, if you're right and this is what's causing the problem does this mean that setting the y velocity to 0 is not the proper action to take when colliding with something from below?

Thanks again for responding :)

Re: yet another collision question thread.

Posted: Tue Apr 22, 2014 1:36 am
by davisdude
I'm fairly certain this is the case, but I can't be sure. I'll look around more when I get some time. :P

Re: yet another collision question thread.

Posted: Mon Apr 28, 2014 7:15 am
by bizziboi
I haven't looked at the source, but if you are going up and hit your head you should set the y velocity to zero *if it's greater than zero, not if it's less'. Otherwise gravity won't be able to make you fall, as you keep negating it's effect by killing vertical velocity - you want to kill upward velocity only.