MiniPlatformer: Characters sticks on ceilings.
by AzraelK · in Torque Game Builder · 10/25/2006 (11:07 am) · 6 replies
Im using a modified version of the miniplatformer demo at tdn and Ive just noticed a curious detail my character sticks on ceilings!
I think the problem is Im using "clamp" as a collision response, so when the character touches the ceiling and a apply a linear velocity clamp will send it forward. is there a way to avoid this?
I think the problem is Im using "clamp" as a collision response, so when the character touches the ceiling and a apply a linear velocity clamp will send it forward. is there a way to avoid this?
#2
10/26/2006 (7:48 am)
Hmm.. isnt there a way to check if the surface im touching is above or below the character, how can I do with the oncollision function?
#3
10/29/2006 (1:03 am)
You could try a castCollision with an upward velocity and set LinearVelocityY to 0 if it detects in incoming collision. (As a temporary fix)
#4
10/31/2006 (7:23 pm)
This problem should be taken care of with the latest miniPlatformerTutorial overhaul. Try using the code there. If there's still a problem, rebuild your level. This helped another person suffering from the same issue. It seems that somewhere along the way the Tile stuff can get a bit screwy.
#5
Thanks!
11/01/2006 (3:33 pm)
Eric and Dan: Thanks, both ideas are great for the purpose (specially checking on the ceiling collision) curiously I fixed the problem with another aproach, I simply made the character jump with less force, now he cant jump two floors high, but he cant get stuck on ceilings either. Also it adds a bit to gameplay since you actually have to use and look for moving platforms and other things to advance.Thanks!
#6
11/04/2006 (4:53 pm)
As long as the player doesn't get stuck on the moving platforms then go for it. I'd personally rather fix the problem on the coding side just in case you ever want to design a level where the player can't really jump that high to begin with... but whatever floats your boat!
Torque Owner Firas