GameMaker How to stop the camera from following an object

Yizzard

Member
So my camera is set to follow the player object using the room properties object following system. (The bottom left corner of the IDE under viewports and cameras then under viewport 0 the Object Following object is set to obj_Player). I have a pause menu where it deactivates everything then spawns in every member of the party on the screen and positions them using the camera_get_view_x(view_camera[0]), and the similar view_y, view_width, and view_height functions, for example
Code:
cx = camera_get_view_x(view_camera[0]);
cy = camera_get_view_y(view_camera[0]);
cw = camera_get_view_width(view_camera[0]);
ch = camera_get_view_height(view_camera[0]);

party1 = instance_create_depth(x, y, depth - 100, global.currentParty[0]);
party1.x = cx + cw/2;
party1.y = cy + ch/3;
I do this so that I can access their variables to display stats and so that I can have their sprites do their idle animation in the menu. However, because of the object following thing, the camera will automatically refocus on one of these party members since they are all descendants of the obj_Player object, and so it causes the camera to move and all my menu items to be in the wrong spots. I would like to just turn off this camera object following function while this menu is up and have it turn back on afterwards, but I can't seem to find any function that does this. Do you all have any idea how to toggle the object following function?
 

TheouAegis

Member
Just set the camera_set_view_object to noone. And if you wanted to follow a specific instance, set the camera object to that instance's ID.
 

Yizzard

Member
camera_set_view_object is not coming up as a script. It's telling me it doesn't know what that is. Is it camera_set_view_target?
 

Yizzard

Member
Oh yeah that was it, thanks lol

I looked through all the camera commands like 3 times, I have no idea how I kept not seeing this one.
 
Top