Hi, I’m a 3D modeler so I don’t have much programming knowledge. I am developing an endless runner and I have found that the performance is better if I keep the pawn stationary and make the tiles move towards it. I’m guessing that since the tiles are moving, the next spawn point doesn’t update with the move and a gap appears. Is there any way to fix it? Should I put the function in the tick event somehow so that the “next spawn point” variable gets updated with the movement?
I’m thinking, if you’re moving the tiles toward the player, the next spawn point never moves.
At the moment it moves, because I’ve set the Spawn point to be the arrow at the end of the static mesh in the tiles blueprint. Do you think that’s the problem?
Yes, it could well be.
If you’re always feeding tiles toward the player, they can always start in the same place
I’ll give it a try. Thank you!!
I think you can do it either way. With the stationary spawn point, you just need to wait for the right moment.
I take that back, you do need to store the location when you start the tile
I think it might be easier to get the tile to spawn the next tile.
How do you get the 0-1 pin in the timeline node? Never used it before.
Double click it.
It’s just a straight line going from 0,0 to 1.1
I will come back later ( things to do )
Ok! Thank you for the help! the thing is that they are not moving now haha I am a mess.
Keep the code you had originally. We’ll get it working !
What code do you have now, what’s happening?
Ok, so that code gives you this tile that does this
If I put 3 of them in a row
and get down one end
If you want more distance, you just start with more tiles.
This tile is 500 long, so my ‘distance’ variable is 500.
Inside the timeline
Nice! I am going to sleep now, I’ll try it tomorrow, thank you! I think there will be a problem because the speed of the tiles is linked with the beat of the music. But it is a huge step forward and I think I could figure the rest out.
They can go any speed you want. Tell me how it goes.
Ok, I got it. But when the timeline ends and the new one spawns you can see the jump is not a continuous flow. I’ll try to combie the two methods. Maybe just measuring the time it takes for one tile to move X distance and spawn the next one just in time to fill the space with an static spawn point. But i will have to link the spawn time rate to the beat of the music too. Harder than I thought haha.
Did you use a straight line in the timeline, or a curved one? ( you can see it’s smooth in my pics ).
You could also use a ‘master spawner’ which has a timer, and just keeps spawning the tiles.
That way, the tiles destroy themselves, but the master spawns them. Then it has to be on time.
Yes, I did
Ignore the first seconds that’s the time it took me to click in the viewport again after clicking on record. That’s why the low fps.
It looks ok
Here’s mine, from the side
To be clear, the player needs to be in the first tile, otherwise they keep seeing the edge
And make sure they’re not overlapping.
It should take exactly the time you set in the timeline ( and will travel exactly the distance ).