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

SOLVED Help with camera!

André Luiz

Member
Hi, I'm Brazilian so I apologize for any English mistakes, okay let's start, I was playing with the game maker studio 2 and there came a time when I had to make a camera for my character, but I couldn't, I saw several codes and videos and I got this flawed result:

#region Camera

halfViewwidth = camera_get_view_width(view_camera[0]) / 2;

halfviewHeight = camera_get_view_Height(view_camera[0]) / 2;

camera_set_view_pos(view_camera[0], x - halfViewwidth, y - halfviewHeight);

#endregion

But, this code makes my character not walk, how do I solve it?

Note: I put this code in the "end step" event
 

TsukaYuriko

☄️
Forum Staff
Moderator
Is your character not walking, or is it always perfectly centered in an otherwise empty room? That'll look like it's not moving because there are no stationary entities to use as a frame of reference to deduce whether the player is moving.

There's no way this code can interfere with the player's movement.
 

André Luiz

Member
Is your character not walking, or is it always perfectly centered in an otherwise empty room? That'll look like it's not moving because there are no stationary entities to use as a frame of reference to deduce whether the player is moving.

There's no way this code can interfere with the player's movement.
i fixed
 
Top