How to move background with character in 2d endless runner?

Hello, I am working on a 2d endless runner and stuck on a small problem. I want to make my background move with my character so that it player feel there is no end of background in my game.

Many many ways to do this. Best way would probably be to spawn a new background when the player gets close to reaching the next section and removing the previous.

I already used arrow and spawn blueprint from class node and set spawn location at arrow it worked but my image is not identical on both ends that’s why it looks a bit weird and so I want my one image background to move with player at player velocity. Please sir suggest any other way.

Oh, well if that’s what you want, then simply move your background to match player location in whatever direction the player moves.

But then wouldn’t it look as though the background is static? Would look a bit weird

I tried it but couldn’t figure it out either my background stops with my player or it moves too fast. Please sir can you give details of nodes which I have to use for this.

Sure. Make your background into an actor. Inside that actor, add your background, and make this code:

Add the background to your scene, and you should be good to go.

133545-2dscoller.gif

It worked thank you sir now my background is moving with my character but it shakes sometimes and also I made a trigger box in actor blueprint below image which when character begin overlap opens ui I made that trigger box is not working

Sir I figured out why my trigger box was not working. I set a branch with dead condition if false then do above thing but if true stop doing that and it fixed my problem thank you for the help.