• 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!

GML [SOLVED] Issue with Camera

Hello! I tried making my camera Zoom Out by following a tutorial and editing the code myself later, which works flawlessly.
But, for some reason, I can't make it stop after an alarm takes off, is there anything I'm doing wrong?
Would appreciate help since im still pretty new to this xD

Create:
GML:
camera = view_camera[0]
Step Event:
GML:
//camera x and y
var camX = camera_get_view_x(camera)
var camY = camera_get_view_y(camera)

//get camera width and height
var camW = camera_get_view_width(camera)
var camH = camera_get_view_height(camera)

var zoom = true
var zoomOut = 1
var _speed = 0.01

if (zoom != false)
{
    zoomOut = zoomOut * _speed
    //add to size
    var addW = camW * zoomOut;
    var addH = camH * zoomOut;

    camW += addW
    camH += addH
   
    //position
    camX -= addW/2
    camY -= addH/2
}
camera_set_view_pos(camera, camX, camY)
camera_set_view_size(camera, camW, camH)

alarm[0] = 60

if alarm[0] = -1
{
    zoom = false  
}
 
Last edited:
Top