Sorry for the confusing title, I’m still not sure the best way to describe things.

I have done a basic endless runner, I changed it a few weeks back so that the track scrolls towards origin, rather than the player infinitely scroll.

I have a Tilemanager that is responsible for creating the tiles - I recently added some collider and rigidbody components to vehicles on my tile, as below:
149565-tilemanager.jpg

My issue is that I need to stop the tile manager scrolling the instantiated tiles and stop the score (accessible on TileManager) when one of the colliders, within my Instantiated prefab, hits my player.

At the minute, if I add:

 void OnCollisionEnter(Collision other)
    {
        GameOver();
    }

    private void GameOver()
    {
       
        Debug.Log("Dead");
    }

To the PlayerMovement script (on Player), the collision works and the note is triggered - However, when I add it to the TileManager script, it doesn’t ever trigger.

I have tried adding the rigidbody to my player and removing it from the vehicles within Instantiated tiles but that didn’t work either.

Is there any way I can do this? Sorry if my explanation isn’t great.

Thanks a lot for any help.

How about giving the player script a reference to the tile manager, and in the OnCollisionEnter on the player, call a method in TileManager to handle whatever changes you want to happen, i.e. stop scrolling, etc…

-Larry