Game Development Community

Adding collisions to your shapes.

by Karsten "Clocks" Viese · in Torque Game Engine · 09/20/2001 (1:24 am) · 7 replies

Just wanted to share this useful infomation about making collisions boxes for your shapes.

If you do not make a collision box you can move through the shapes in the game like you can with the trees in the example, and this might not alway be desireable.

So this is how you do it.

1. Make any shape you like.
2. Setup all the usual stuff like, bounds, shape dummy, start dummy etc....
3. Make a dummy called "Collision-1" and link it to the shape dummy.
4. Make a new box (or a simple model if a box wont do) where you want to collide with your model and name it Col-1. This you need to link to the start dummy.
5. Export the model.
6 Run the testapp and open the editor and place the new shape.

Now you should collide with the shape where you placed the Col-1 model.

// Clocks out

#1
03/14/2002 (3:25 pm)
I really appreciate your post.

I've been having major problems with the collision system. I have setup my models like you specified and the documentation specifies but nothing changes, I can still pass thru the models. I even tried one of the models that comes with the "torque_max_filepack.zip" and it doesn't work either. I'm a "newbie" at torque (rather seasoned with Max) but I'm at a real loss here. I'm not sure if I'm doing something wrong, if I'm missing a plugin, or if it's something else all together.
Any help that anyone can provide would be greatly appreciated.
#2
03/26/2002 (6:33 pm)
Any luck yet Todd?
#3
03/27/2002 (12:25 am)
In order to see if your model has a collision box, you can also set in the exporter (on milkshape, i do not know for 3DS) to make a visible copy of your collision box. Then it will be easier to debug it.
#4
03/27/2002 (9:48 am)
No luck yet. I figured out how to replace a tree with my model and when I did that it worked just fine. I also sent Joe a sample file and it worked for him. It just doesn't work in the game. I'm waiting for Justin to look into it. I don't think there is anything else I can do.
Again, I would like to thank everyone for all of your helpful suggestions. It has been very much appreciated.
#5
03/27/2002 (11:08 am)
I'm also having troubles with model collisions. If anyone would be so kind, my complete tree model is at http://fafhrd_pro.tripod.com/downloads.htm
Its in .max format, with a .png
I've read every single post relating to collision, and Im damn sure I have my nodes properly organized, except it doesn't work.
#6
03/27/2002 (11:18 am)
The collicion model need to be convex, if its not you can walk through it. If you cannot make the collision model convex in one model then make more models and then name each model col-1, col-2, col-3, etc.....

Also make a new collision dummy for each col model, and name them the same, collision-1, collision-2, etc.....

// Clocks out
#7
03/27/2002 (11:30 am)
Hey Erik, I downloaded your file. I'll check it out tonight after work.