Game Development Community

Problem with collisions for player

by Andy Hawkins · in Torque Game Builder · 11/30/2008 (8:39 pm) · 3 replies

I have a player running around in a maze. With the following settings he collides with the wall, but nothing else

Send Collisions
Receive Collision
Send Physics
Receive Physics

If I turn any of these off I no longer collide with the walls. The walls are done by painting tiles with collision set on.

The problem is, I can't collide with my npcs or enemies. Everyone has polygon collision masks, and the npcs and enemies detect when I shoot a bullet at them using the following code...

// Turn on collision, but turn off physics
   %this.setCollisionActive( true, true );
   %this.setCollisionPhysics(false, false);
   %this.setCollisionCallback(true);

.. and npcs detect the walls too. I just can't collide with them with my character. What's the trick?

#1
12/01/2008 (5:32 am)
I'm gonna try attaching an invisible object for the time being, but I would be happy to hear some advice on how to do it properly.
#2
12/01/2008 (5:42 am)
Double-check your layer masks in the builder for your collisions and that you are sending/receiving on all layers.
#3
12/01/2008 (7:02 am)
Yep that worked - thanks. I turned on all the layers.

I can also push the other players around :) Thank you!