S
Sylveax
Guest
Hi everyone. Nice too see that the GMC is back. Now to my problem:
I'm trying to deactivate all instances of a certain object that aren't inside the area visible to the camera (the players field of view). Everything I could think of was the point_in_triangle function, like this:
the 40 is there because the players FOV is set to 80 with d3d_set_projection_ext.
the only problem with that is the fact that I can't reactivate the instances once they're deactivated, because of course they don't run their step event code. I've searched google, the marketplace, reddit, the manual, the GMC, literally anything I could think of, for a solution. Didn't find even a single, remotely related result. Does anyone of you have an Idea? I would be extremely thankful!
I'm trying to deactivate all instances of a certain object that aren't inside the area visible to the camera (the players field of view). Everything I could think of was the point_in_triangle function, like this:
Code:
STEP EVENT
if point_in_triangle(x,y,obj_player.x,obj_player.y,obj_player.x+lengthdir_x(1000,obj_player.direction+40),obj_player.y + lengthdir_y(1000,obj_player.direction+40),obj_player.x+lengthdir_x(1000,obj_player.direction-40),obj_player.y + lengthdir_y(1000,obj_player.direction-40)) {
instance_deactivate_region(x,y,0,0,1,false)
} else {
instance_activate_region(x,y,0,0,1)
}
the 40 is there because the players FOV is set to 80 with d3d_set_projection_ext.
the only problem with that is the fact that I can't reactivate the instances once they're deactivated, because of course they don't run their step event code. I've searched google, the marketplace, reddit, the manual, the GMC, literally anything I could think of, for a solution. Didn't find even a single, remotely related result. Does anyone of you have an Idea? I would be extremely thankful!
Last edited by a moderator: