CloseRange
Member
I've started to try and figure out game maker 2's camera system and I thought I had it down but I can't do something as simple as getting the camera's position....
i'd expect it to show me the message "250" as that should be the camera's x position, however it still only shows me '0'
I tried adding camera_apply(cam); before i got the position but still, nothing.
Code:
x = 250;
y = 250;
var cam = camera_create();
var vm = matrix_build_lookat(x, y, -10, x, y, 0, 0, 1, 0);
var pm = matrix_build_projection_ortho(640, 480, 1, 1000000);
camera_set_view_mat(cam, vm);
camera_set_proj_mat(cam, pm);
view_camera[0] = cam;
show_message(camera_get_view_x(view_camera[0]));
I tried adding camera_apply(cam); before i got the position but still, nothing.