set_view_position

Overrides the camera position. Use the functions

view_get_xview()  Reference→
and

view_get_yview()  Reference→

for the arguments if you don’t want to override them. The camera will be restricted to the edges of the stage in base game stages, but will be fully unlocked on workshop stages.

ArgumentTypeDescription
x:realThe X coordinate to set the camera to
y:realThe Y coordinate to set the camera to

Example, called from animation.gml:

//This will focus the camera on the player if they trigger the purple kill effect when hitting another player, but not if they're hit themselves.
if (activated_kill_effect && state_cat != SC_HITSTUN ) {
set_view_position(x, y - (char_height / 2) );
}