Game Development Community

How to do collision without physics component?

by Matthew Johnson · in Torque X 2D · 08/08/2009 (12:14 pm) · 2 replies

I'm new to using Torque and the game builder. I've figured out a lot of stuff, but in my 2D game, I don't need physics. As such, I'd like to not need the physics component attached to any of my game objects.

Unfortunately, I can't seem to get the collision component to work unless the physics component is also attached to the object. My OnCollision delegate never gets triggered.

Is there a way to get collision without physics or must they go hand in hand?

Thanks!
Matt

#1
08/08/2009 (2:17 pm)
I am pretty sure you need a physics component. What seems to work is a trigger component without a physics component.
#2
08/08/2009 (3:29 pm)
If you just need to know when one object hits the other, just use the trigger componenet. You can make delegates for OnEnter, OnStay and OnLeave.