# Why doesn't my object collision work?

This topic is 2031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

[s]Here's the code to show what I'm doing:

[CODE]
static float (* FrontX)[4] = new float[ObjectQuantity][4];
static float (* FrontY)[4] = new float[ObjectQuantity][4];
static float (* FrontZ)[4] = new float[ObjectQuantity][4];
static float (* BackX)[4] = new float[ObjectQuantity][4];
static float (* BackY)[4] = new float[ObjectQuantity][4];
static float (* BackZ)[4] = new float[ObjectQuantity][4];
for (int count = 0; count < 4; ++ count)
{
FrontX[ObjNum][count] = front[count].x;
FrontY[ObjNum][count] = front[count].y;
FrontZ[ObjNum][count] = front[count].z;
BackX[ObjNum][count] = back[count].x;
BackY[ObjNum][count] = back[count].y;
BackZ[ObjNum][count] = back[count].z;
}
for (int count = 1; count < ObjectQuantity; ++ count) //count 1+ because 0 is player, other objects wont collide
{
for (int CountCorner = 0; CountCorner < 4; ++ CountCorner)
{
if (FrontX[0][CountCorner] == FrontX[count][CountCorner])
{
Movement = FALSE;
}
}
}
[/CODE]

I'm only checking the Front X corners of every object, just to check if they collide, but movement never turns false. If I change the == operand to bigger or smaller, then movement becomes false... HOW?? What exactly am I doing wrong here? I tried bashing my player into a wall walking straight, backwards, turning, whatever..[/s]

Nevermind! I figured it out myself. Even though now bound drawing system is bugged somewhat, but oh well... Edited by theo2005