• 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 Camera center code is making sprite displace when it moves

Hello, i've been noticing that my sprite gets displaced to whenever direction i add speed and it gets worse the higher the speed.
Then i've made a test removing my center camera code and it seems that for some reason the problem happens when the camera is centered on my player.

This is my code for centering the camera on player

GML:
    wcameraset = x - view_wport[0]/2;
    hcameraset = y - view_hport[0]/2;

    camera_set_view_pos(view_camera[0], wcameraset, hcameraset);
Am i doing it wrong? I tried other methods to get the camera centered on the player but none actually worked.
 

TsukaYuriko

☄️
Forum Staff
Moderator
When are you setting this? Make sure it's after the player moves and before anything gets drawn.
 
Top