Game Development Community

How to use collision without physics

by Nic Biondi · in Torque Game Builder · 11/26/2008 (6:55 pm) · 4 replies

Hello gang.. I have a ball that I want to collide with a star. When the ball collides with the star I want it the star to disappear without the ball colliding with it changing direction. Consider Mario picking up a mushroom if you are still unclear as to my intention of the behavior.

So I have noticed that even if I turn off the all the physics on the star I want to collect, my ball still bounces off of it. I have to have collision on other wise I can never know when the ball has collected a star from colliding on it. I assume since I am sensing the collision from the object it's self, and not the star.

So is there a way to make sure that when I collide I can take action BEFORE, the physics of my object?

#1
11/26/2008 (7:12 pm)
You can just turn off the collision response, or you can use a trigger instead.
#2
11/27/2008 (2:19 am)
Thanks Phillip, for the timely response.
However, if I turn off the collision response on the "star" then the callback will not be used, and since no collision is triggered, I cannot tell the game that I've collected a star.

I could use a trigger I suppose. That might do what I am looking for. I couldn't use that a while ago since triggers were broken in a previous build for a couple months... I think I'm going to take you up on your trigger suggestion Phillip, thanks!

cheers
-nic
#3
11/27/2008 (2:41 am)
Thanks Phillip, for the timely response.
However, if I turn off the collision response on the "star" then the callback will not be used, and since no collision is triggered, I cannot tell the game that I've collected a star.

I could use a trigger I suppose. That might do what I am looking for. I couldn't use that a while ago since triggers were broken in a previous build for a couple months... I think I'm going to take you up on your trigger suggestion Phillip, thanks!

cheers
-nic
#4
11/27/2008 (2:43 am)
Praise report!
Worked like a charm! I created little "star" images with the classname=star. Then I added some code to their onLevelLoaded constructors to mount a trigger with a circular collision box to it which calls getMountedParent().safedelete(). works like a charm.

now why didn't I think of that?!

thanks!
-nic