A
AGW
Guest
Hello, what I want to do in my game is to make the background follow the camera.
Any idea on how this would be made?
Thanks in advance.
Any idea on how this would be made?
Thanks in advance.
background_x[0] = view_xview;
background_y[0] = view_yview;
Unafortunately, backgrounds work differently in GM:S 2, so this code won't work. Still, thanks for helping tho. I will see what can I do.Create an object to manage your background movement and add this code to its step event. (Don't forget to put this object into your room)
[0] this number for your background, if you have more than one bg. change the number according to your bg.Code:background_x[0] = view_xview; background_y[0] = view_yview;
I also suggest you watch Pixelated Pope's parallax scrolling tutorial. It will make you grasp the concept much better.
[Post-Edit]
I just realized you are trying to achieve this in GMS2. I'm not sure if there are any syntax differences for view or background. But I presume above code would work. Still, I suggest you learn about Parallax Scrolling. Which will make you able to create more with backgrounds, such as creating a depth illusion.
I would do that, but my background is divided in many images for a parallax scrolling, so it would be a little complicated to do.Did you try drawing a sprite image as the background and set it to follow the camera's view position?
Do you still have this tutorial, because I have such problem too and i can`t find the solution?Nevermind everyone, I found a tutorial on youtube on how to do what I wanted.
Still, thank you, everyone, for trying to help with my problem.