GML How I can fix backgrounds lagging behind player?

E

Edwin

Guest
I have this code in Step Event:
Code:
background_x = view_xview;
So it's moving as I need but it lagging behind the view. How I can fix it?

This is how background (sun) moves:
ezgif.com-video-to-gif.gif
 

TheouAegis

Member
Which version of Game Maker? GM8? Move it to tge End Step event. Worst case scenario, you will need to factor in the player's speed as well.

In Studio, you could use the Predraw event.
 
E

Edwin

Guest
Which version of Game Maker? GM8? Move it to tge End Step event. Worst case scenario, you will need to factor in the player's speed as well.

In Studio, you could use the Predraw event.
Thanks. I will try Predraw Event when I will be free.
 

Yal

šŸ§ *penguin noises*
GMC Elder
Also, if you let GM move the view rather than doing it manually, you might wanna consider switching over to controlling it yourself... then you're 100% sure in what order you do things, so you can move the view first and THEN update the background.
 
E

Edwin

Guest
Also, if you let GM move the view rather than doing it manually, you might wanna consider switching over to controlling it yourself... then you're 100% sure in what order you do things, so you can move the view first and THEN update the background.
Thanks for advice. I'll keep it on mind.
 
Top