BarrowBloke
Member
Hi,
I'm getting some false collision events between 2 instances but this only occurs when I'm running the debugger.
Is this a known bug?
Some more details:
I have an object instance that I've called objCalibrationBox in the centre of the room. When the player presses a gamepad button an instance of objPlayer is created at 0,0 in the room.
When the player is created there is a large gap between the player and the calibration box i.e there is no overlap or possibility of a collision
And I draw a yellow rectangle using the bbox variables of each instance to confirm this.
If I just 'Run' the project then all is fine.
However, if I 'Debug' the project using F6 then I get a crash in the collision event of objCalibrationBox at the moment the player is created because the objCalibrationBox id is 0 (the collision code is in the objCalibrationBox so I'm not sure how this happens!)
To catch this I used an IF statment on id as follows:
And I found the Output tab filling up with "collision error: id == 0. Erm...how? " while the player was in an area the size of the calibration box in the top left of the screen.
Almost like it thought the calibration box was in the top left of the screen even though it was plainly visible in the centre of the screen and could be correctly collided with there.
As always, any help or insight is much appreciated!
Regards,
Barrowbloke
I'm getting some false collision events between 2 instances but this only occurs when I'm running the debugger.
Is this a known bug?
Some more details:
I have an object instance that I've called objCalibrationBox in the centre of the room. When the player presses a gamepad button an instance of objPlayer is created at 0,0 in the room.
When the player is created there is a large gap between the player and the calibration box i.e there is no overlap or possibility of a collision
And I draw a yellow rectangle using the bbox variables of each instance to confirm this.
If I just 'Run' the project then all is fine.
However, if I 'Debug' the project using F6 then I get a crash in the collision event of objCalibrationBox at the moment the player is created because the objCalibrationBox id is 0 (the collision code is in the objCalibrationBox so I'm not sure how this happens!)
To catch this I used an IF statment on id as follows:
GML:
show_debug_message("player collided with calibration box");
if(id > 0) {
if(calibrating == false) {
other.x = x - 400; // move it away so we don't re-trigger calibrating later
GP_names = get_GP_names();
chosen_GP_ID = 0; //go to 1st entry
calibrating = true; // set our own flag
}
}
else if(id == 0) {
show_debug_message("collision error: id == 0. Erm...how? " + string(random(100)));
}
Almost like it thought the calibration box was in the top left of the screen even though it was plainly visible in the centre of the screen and could be correctly collided with there.
As always, any help or insight is much appreciated!
Regards,
Barrowbloke