pathetic terrain trace reliability

Posted By: Impaler

pathetic terrain trace reliability - 03/03/07 13:05

Hi,
I have just tried using terrain in a game level, and previously I had only used blocks. Anyway, there are a bunch of problems with is. one is that tracing from a bullet in front of it to detect where it hits things doesn't work. Here's the basic script:

my.x += 300 * cos(my.pan) * time;
my.y += 300 * sin(my.pan) * time;
my.z += 300 * tan(my.tilt) * time;

trace_mode = ignore_me;
trace(my.x, vector(my.x + 300 * cos(my.pan), my.y + 300 * sin(my.pan), etc... ;
if(trace(my.x, vector(my.x + 300 * cos(my.pan), my.y + 300 * sin(my.pan), my.z + 300 * tan(my.tilt) <300)
{
my.x = target.x; // and all this makes the bullet actually hit the surface.
my.y = target.y;
my.z = target.z;
}

but this only works some of the time with terrain, but with blocks it works 100% of the time. Sometimes it just goes straight through the terrain. What's happeneing?
Posted By: Anonymous

Re: pathetic terrain trace reliability - 03/03/07 13:10

Use my.enable_block = on; and my.enable_entity = on; and attach it to you bullet entity
then
function bullet_event
{
if(event_type = event_entity)
{
...
}
and so on

sry for my bad english
Posted By: Impaler

Re: pathetic terrain trace reliability - 03/03/07 13:14

Wow, you replied really quickly(so quickly that I didn't even have time to tell everyone to ignore this posting because I put it in the wrong place!!!) Sorry everyone!. Oh, and I tried that using the built in collision detection thing but it doesn't work well with bullets . Thanks anyway.
Posted By: xXxGuitar511

Re: pathetic terrain trace reliability - 03/03/07 20:47

Moved Here
Posted By: Matt_Aufderheide

Re: pathetic terrain trace reliability - 03/04/07 07:41

use ctrace, not trace.
© 2024 lite-C Forums