Sticking to underside of platforms when jumping.
by Max Nichols · in Torque Game Builder · 03/10/2008 (10:43 am) · 7 replies
I'm trying to create a simple platformer, based on the miniplatformer tutorial, and I'm running into a problem: when the player jumps, the avatar often sticks to the underside of platforms. From what I can tell, if he jumps straight up without any horizontal movement, it doesn't stick - but add any horizontal movement and the avatar's head will stick to the bottom every time. Once stuck, the player can still move side to side, but they can't get off the platform.
From what I can tell with some of my peers, it's a pretty common problem, but I couldn't find another thread on the subject.
Thanks in advance.
From what I can tell with some of my peers, it's a pretty common problem, but I couldn't find another thread on the subject.
Thanks in advance.
#2
03/10/2008 (2:34 pm)
Have you tried having only one point of contact on the bottom of the platform? Like, instead of having a flat topped collision poly for your player, have a peaked pyramid top? This should mean that only one point contacts the base of the platform, and may reduce the chance of getting stuck. Give it a go and see what happens.
#3
I do this with Unek, and it greatly reduces the frequency at which the sticks happen, but doesn't totally eliminate them. Nevertheless, it seems like it would be a good thing to do.
Sorry for not mentioning that Max, good thing Phil is around to watch your back!
03/10/2008 (4:43 pm)
Phil,I do this with Unek, and it greatly reduces the frequency at which the sticks happen, but doesn't totally eliminate them. Nevertheless, it seems like it would be a good thing to do.
Sorry for not mentioning that Max, good thing Phil is around to watch your back!
#4
Alright, question #2: I want to have the player jump at a platform and grab it to pull himself up, Prince of Persia style. I'm not sure what the best way to go about doing this would be; any advice?
EDIT: Those techniques seemed to have helped with the sticking. Thanks a bunch, I really appreciate it.
03/12/2008 (6:43 am)
Thanks a lot, guys. I'll give those a try, and let you know if it works. Alright, question #2: I want to have the player jump at a platform and grab it to pull himself up, Prince of Persia style. I'm not sure what the best way to go about doing this would be; any advice?
EDIT: Those techniques seemed to have helped with the sticking. Thanks a bunch, I really appreciate it.
#5
RE Question 2: I would tackle that problem by adding an invisible t2dSceneObject to the ledge and position it so that it juts out a hair beyond the actual ledge. I would then set an the collision callback to say "Collided with grabable!" or somesuch. The other way to approach this would be to use a t2dTrigger configured similarly and use the associated onEnterTrigger/whathaveyou callbacks to set a "canClimb" variable or something.
Does that make sense?
04/03/2008 (7:58 pm)
@Max:RE Question 2: I would tackle that problem by adding an invisible t2dSceneObject to the ledge and position it so that it juts out a hair beyond the actual ledge. I would then set an the collision callback to say "Collided with grabable!" or somesuch. The other way to approach this would be to use a t2dTrigger configured similarly and use the associated onEnterTrigger/whathaveyou callbacks to set a "canClimb" variable or something.
Does that make sense?
#6
I've been experimenting with acrobatics in Unek. You can find Unek at www.syrealgames.com
04/04/2008 (3:55 pm)
Another alternative would be to have two sensors mounted to the front of your player character, one for the upper half, one for the lower half. If the bottom sensor is activated and the top one is not, then initiate a ledge grab.I've been experimenting with acrobatics in Unek. You can find Unek at www.syrealgames.com
#7
Check the Mini platformer tutorial on TDN , I updated it last year, maybe its still there.
Hi everyone, its nice to be back here, I have recovered fully and hopefully will start creating 2d games using TGB and TXB soon on regular basis.
I have been busy doing graphic works to run my family.
Any idea where should I find a TGB programmer to partner with me on games here?
I am still bad with programming.
regards
Sunny
www.wickedsunny.com
04/07/2008 (7:57 pm)
Max NicholsCheck the Mini platformer tutorial on TDN , I updated it last year, maybe its still there.
Hi everyone, its nice to be back here, I have recovered fully and hopefully will start creating 2d games using TGB and TXB soon on regular basis.
I have been busy doing graphic works to run my family.
Any idea where should I find a TGB programmer to partner with me on games here?
I am still bad with programming.
regards
Sunny
www.wickedsunny.com
Torque Owner Kevin James
I have not tried this to see if it works as a solution, but it definitely seems like a viable workaround. Whenever the player hits the bottom of a platform, call something to the effect:
Let me know if it works.