L
L1NDHOLM
Guest
Hello, i'm wondering what the best way could be to make objects that go outside my view_camera[0] to "reset".
For example if im in a 2d platformer and move forward (to the right) and kill some enemies & run past some enemies then go backwards (left) i want them to respawn where i put them in the room when i designed it.
My current solution only deactivates objects in a specific layer when outside my view_camera[0], like this:
Thanks.
For example if im in a 2d platformer and move forward (to the right) and kill some enemies & run past some enemies then go backwards (left) i want them to respawn where i put them in the room when i designed it.
My current solution only deactivates objects in a specific layer when outside my view_camera[0], like this:
Code:
inst_lay_id = layer_get_id("Instances");
instance_deactivate_layer(inst_lay_id);
var cam, cleft, ctop, cw, ch;
cam = view_camera[0];
cleft = camera_get_view_x(cam);
ctop = camera_get_view_y(cam);
cw = camera_get_view_width(cam);
ch = camera_get_view_height(cam);
instance_activate_region(cleft, ctop, cw, ch, true);