Game Development Community

Collision Problem

by Charles Speer · in Torque X 2D · 05/14/2008 (8:56 pm) · 2 replies

I've got 2 sqaure objects in my game both using CollisionBoxShape. One object is the player and another is a moving platform in mid-air. When my player lands on it, the physics sometimes does crazy stuff and shoots the player off. So I wanted to 'stick' the player to this moving platform when he lands on it. However, after implementing the 'stick' code, the player will stick if it hits the sides and even the bottom of the platform. I just want the OnCollision function to call (or at least just the code in the OnCollision function to execute) when the player lands on TOP of the platform, and not on the sides or bottom. But I still want collision to stop the velocity of the player on the sides and bottom.

Has anyone found a similar solution to something like this? Like maybe a teleporter that teleports when the player lands on top of it, but not when the player hits the side of it. Any help is appreciated.

#1
05/19/2008 (5:20 pm)
I am also having a trouble with the square collisions since Torque X 2.0 update. On 1.0, my 'box' object worked fine when it fell from the sky and landed on the floor. I had a box collision shpare on it. I ran the SAME code on 2.0, and the box fell right through the floor. Since then, I used a sphere collision shape instead of a box and it seemed to work fine, but there are instances that I wish I had the box. Anyone else have the same problem?
#2
05/22/2008 (5:43 pm)
Another issue: I'm trying to collide a TorqueObject with a regular RigidComponent setup with another TorqueObject that has T3DStaticGeometryComponent. Basically, I want my player to to call it's OnCollision() function when it hits the level boundries. However, it only calls when the regular RigidComponent setup is on that object. I don't want to give my level boundries a RigidComponent because there is no particular collision 'shape' that I want to give it. That is why I'm using poly soup. Has anyone conquered this problem already?