R
r7465
Guest
So I'm working on a room where rooms have a bit too many objects and they despawn unless the player is near them. How can I fix this?
What part of it? The items that disappear have no code, just depth. The player has an activate/deactivate function for objects out of the view but that's unrelated as it seems.Can you show us your code?
The code that makes the objects out of the view disappearWhat part of it? The items that disappear have no code, just depth. The player has an activate/deactivate function for objects out of the view but that's unrelated as it seems.
I'll message you the GMK file if you want it though.
The code that makes the objects out of the view disappear
instance_deactivate_all(true)
instance_activate_region(view_xview-240, view_yview[0], view_xview+(240*view), view_hview[0], true); // main activation code
instance_activate_region(x-250,y-250,x+250,y+250,true); // backup activation code
instance_activate_object(obj_arrow)
instance_activate_object(obj_bg)
instance_activate_object(obj_draw)
instance_activate_object(obj_firedarrow)
instance_activate_object(obj_vertcam)
instance_activate_object(obj_block) // to prevent the player falling in a hole
instance_activate_object(obj_enemybase) // to prevent errors
instance_activate_object(obj_enable)
instance_activate_object(obj_newcam)
instance_activate_object(obj_snowball) // in case it goes over the view
instance_activate_object(obj_polarview)
instance_activate_object(obj_camerapb)
instance_activate_object(obj_polarbear)
instance_activate_object(obj_wall)
instance_activate_object(obj_spikegenerator)
instance_activate_object(obj_drill)
On the second line, what do you have the "view" variable set to?I don't really think this has to do with it but hope it works. I tried removing the backup activation code and it didn't change.Code:instance_deactivate_all(true) instance_activate_region(view_xview-240, view_yview[0], view_xview+(240*view), view_hview[0], true); // main activation code instance_activate_region(x-250,y-250,x+250,y+250,true); // backup activation code instance_activate_object(obj_arrow) instance_activate_object(obj_bg) instance_activate_object(obj_draw) instance_activate_object(obj_firedarrow) instance_activate_object(obj_vertcam) instance_activate_object(obj_block) // to prevent the player falling in a hole instance_activate_object(obj_enemybase) // to prevent errors instance_activate_object(obj_enable) instance_activate_object(obj_newcam) instance_activate_object(obj_snowball) // in case it goes over the view instance_activate_object(obj_polarview) instance_activate_object(obj_camerapb) instance_activate_object(obj_polarbear) instance_activate_object(obj_wall) instance_activate_object(obj_spikegenerator) instance_activate_object(obj_drill)