I've bypassed the floating boxes now and I'm performing a trace directly from my player to the vectors where the boxes would have been located.
while(1)
{
.........
FrontRightPos.x = my.x + (50 * cos(my.pan)) + (50 * sin(my.pan));
FrontRightPos.y = my.y + (50 * sin(my.pan)) - (50 * cos(my.pan));
FrontRightPos.z = my.z;
FrontLeftPos.x = my.x + (50 * cos(my.pan)) - (50 * sin(my.pan));
FrontLeftPos.y = my.y + (50 * sin(my.pan)) + (50 * cos(my.pan));
FrontLeftPos.z = my.z;
if(c_trace(me, FrontRightPos, IGNORE_ME | IGNORE_MODELS | IGNORE_SPRITES | IGNORE_CONTENT)>0)
RightWall = 1;
if(c_trace(me, FrontLeftPos, IGNORE_ME | IGNORE_MODELS | IGNORE_SPRITES | IGNORE_CONTENT)>0)
LeftWall = 1;
if(RightWall == 1 && LeftWall == 1)
{
dash = 0; my.animation = 0; FrontWall = 1; WallRunning = 1;
printf("Front Wall!");
}
else if(LeftWall == 1 && RightWall == 0)
{
dash = 0; my.animation = 0; WallRunning = 1;
printf("Left Wall!");
}
else if(RightWall == 1 && LeftWall == 0)
{
dash = 0; my.animation = 0; WallRunning = 1;
printf("Right wall!");
}
.............
}
Both booleans "Leftwall" and "Rightwall" are set to 1 the moment I run the function that checks, regardless of how far away the player is from a wall. I tried using HIT_TARGET and got the same results.
c_trace(me, FrontRightPos, IGNORE_ME | IGNORE_MODELS | IGNORE_SPRITES | IGNORE_CONTENT);
if(HIT_TARGET)
{
RightWall = 1;
}
These first two options ALWAYS respond as if a wall was detected, even if it wasn't. If I use hit.nx to check, I'll never get a positive response, wall or not.