Game Development Community

[Help] How to tell if a 'player' object has touched a StaticShape or TSStatic

by Nicolai Dutka · in Torque Game Engine Advanced · 10/13/2009 (10:37 pm) · 3 replies

Ok, so I have a player object derived from a default player (player.cs). The object can be manipulated in mid-air like a telekinesis type thing... I need to run some code when said object has been set down. I can quite easily do a 'distance from terrain' check, but what if the object is set down on top of another object whether that be a TSStatic or StaticShape? In that case, my 'distance from terrain' check will never tell me the object is close enough to the terrain because the object was just set down on top of another object...

I tried using the 'onCollision' method for the player derived object, but it only gives me results when it collides with other players...

Any ideas?

#1
10/13/2009 (11:40 pm)
How about using the callbacks from the StaticShape's onCollision? TSStatic won't give any callbacks, it's not how it's setup.
#2
10/14/2009 (5:00 pm)
i dont understand what is the question, but are you using raycast and set the collision masks?
#3
10/14/2009 (5:17 pm)
Actually, we just adopted a 'containerBoxEmpty' check to see if there is anything directly under the player's feet which is working out very nicely. ;)