SetActorLocation causing z-fighting

I am making a endless runner and i have a system wich spawns tiles of a specific size. My character doesn’t move, but all other actors move along the x axis, using a component.

This is the spawning of my first 10 tiles at begin play. I have a actor placed in the world, that handles the whole system:

This is the spawning of every new tile, after the game has started. After one tile hits the bounds of the level (which i made using a collision box), it destroys it and runs the spawning.

Here are the SpawnLine and SpawnedLineLocationSet:

As you can see, i set the rear tile and spawn every other tile 500 units behind it. I am 100% sure that the tiles are 500 units long.
The problem that occurs is, that when the tiles start moving, they start to spawn slighly into each other. This causes the z-fighting. I am not sure how to counter this problem, as i am a noob, so any help will be appreciated.
Thanks in advance!

I think the issue is coming from the SpawnLine function. I see you are setting z there to -1000, but after that you call SpawnedLineLocationSet and change this to 0. Not sure if this is intended, but my guess is that you forgot to pass the y and z values from rear line to the SetActorLocation box in screenshot-21.png

How are you doing the movement?

Maybe you’re over-thinking it. I made a runner just now, only using this:


Using a Blueprint Component

The tile first spawns at z = -1000 and after that i move it to the desired location, behind the last tile. Bute because i need the y and z to be 0 and not change, i just dont hook them up. I tried to spawn it directly behind the rear tile, but i does the same thing. The tile does not spawn 500 units behind it, but slightly into the rear tile, but at the correct z and y values, which are 0

I asked again :), here is the answer: link