Le Slo
Member
Hello!
I'm trying to make a specific deactivating system because of some objects I have in my game should behave differently to this matter. I started trying to replicate the instance deactivate region function. So my code looks like this:
I've banging my head with this simple thing. Each step the number of activated instances is different (there are only two values per position of the camera) even when the camera is not moving at all, and almost all the instances of the room are activated. What am I missing here?
I'm trying to make a specific deactivating system because of some objects I have in my game should behave differently to this matter. I started trying to replicate the instance deactivate region function. So my code looks like this:
Code:
var value=1;
var NCX=obj_camera.camX;
var NCY=obj_camera.camY;
var NW=obj_camera.width;
var NH=obj_camera.height;
instance_activate_region(NCX-NW*value,NCY-NH*value,2*value*NW,2*value*NH,true);
//instance_activate_all();
with(all){
if(object_index!=obj_camera && object_index!=obj_player){
if(x<NCX-NW/2 || x>NCX+NW/2 || y<NCY-NH/2 || y>NCY+NH/2 ){
instance_deactivate_object(id)
}
}
}