Game Development Community

Having a problem with collision

by Jacob Neville · in Torque 3D Professional · 11/27/2009 (12:37 pm) · 5 replies

I'm spawning some TSStatic objects in the level, but the collision detection on them is very troublesome. These are collada objects exported from Maya that will act as the foundation of the level, but when I move from one section of the floor to another (either by walking or jumping) I almost always fall through it, and often times bullets don't collide either. Sometimes at certain angles things will collide with it, but other times it won't.

I'm wondering if I might have done something wrong on either the model or in code that would be causing this?

The model is set up like so:
www.supersmiley.net/images/temp/modelsetup.jpg
Here is the code I'm using to spawn the objects:
function createMyShape(%pos)
{
   %create = new TSStatic()
   {
      shapeName = "./interiors/basicroom.dae";
      collisionType= "Collision Mesh";
      decalType= "Visible Mesh";
      scale = "25 25 25";
   };
   MissionCleanup.add(%create);
   
   echo("Creating room at: "@%pos);
   %create.setTransform(%pos);
}

function mazeStage3()
{
	for(%i=0;%i<$mazeLength;%i++)
	{
	   createMyShape(VectorScale($mazeRoom[%i],6)); //spawn the rooms 6 units apart
	}
}

Anyone able to spot something i'm doing wrong?

PS: I'm getting "Warning: shape basicroom.dae collision detail 0 (Collision-1) bounds exceed that of shape." This tells me I might have done something wrong with the model, but I don't know what.

#1
11/28/2009 (12:57 am)
I'm also having a problem with collision in T3D 1.1 Alpha.
I have a collision mesh around the trunk of a tree.
The collision mesh shows up under shape editor, but avatar runs through trunk with no collision.

Tried it also with example tree from forest kit. Collision mesh shows up in shape editior, but no collision in game.

Think this is a bug!
#2
11/28/2009 (12:16 pm)
@Jim
Forest collision issue sounds like this.
#3
11/28/2009 (7:15 pm)
You can use the visible collision i think. Is very good and any player collision on it if can see this static.

collisionType = "Visible Mesh";
#4
11/28/2009 (7:24 pm)
what Dimitris said. i found also founf that method easier. since then i havent had any collision issues. hopefully that will work for your particular project.
#5
11/28/2009 (7:30 pm)
Yes working properly on my project and i have all config with visible mesh, except characters (players and AI, have the collision from 3ds where i have design, all statics is from 3ds without collision sets)