• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GMS2 Trigger Camera zoom

L

Liiam.Jn

Guest
Hey people, I am new to GM and would really appreciate it if someone could point me in the right direction. I am working on a top down rpg and I would like the camera to zoom out at a selected area my that my player reaches. I have looked on youtube, and multiple forums and haven't come close to a solution yet. I am using the GMS2 camera system, and I am having a lot of trouble figuring this out. I have placed an object (obj_trig) into my room to highlight the area that I want to trigger the zoom out effect, then once the player leaves the highlighted area, I want the view to zoom back to it's original size. but I just can't figure it out. any help would be greatly appreciated.

I have written this code into my camera step event:

///zoom
if place_meeting(x,y,obj_trig)
{
var pm = matrix_build_projection_ortho(710,660,1,10000);

}
else {
var pm = matrix_build_projection_ortho(410,260,1,10000);
}
 
Top