Also, here’s a quick alternative since that should be quite performant and suitable for infinite runners. It does not rely on indexing and is event driven. It may not fit with your game design / concept though. I’m gonna leave it here in case you want to experiment:
The player has an overlapping volume behind them:
And each tile fires onEndOverlap if it collides with the player.
No casting, no Ticking, no arrays, no indexing.


