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