Determine what number roulette ball is on.

Hello! I am making a classic roulette game. I have a ball that falls on a wheel and the wheel rotates and stops. Once the wheel stops the ball stays secure in the number that it is in by small colliders on the sides. I was wondering how I would now determine what number the ball is laying on. I am fairly new to unity and I went looking on this forum but couldn’t find any answers. Thank you.

In the Collider GameObjects for the roulette tiles, create a new collider extruding slightly from the bottom collider. Make sure you check IsTrigger and give it a tag. (I reccomend “RouletteTile”)

Add a new script to the roulette tile game objects that contain the new collider. Call it “TileNumber” exactly like that. Inside the script, add public int number; above the Start() void. In the Editor, navigate to the script. For each tile, enter the number of the tile.

Then inside the script for the ball, test which collider it is inside.
public int number = 0;

void OnTriggerEnter(Collider other){
number = other.gameObject.getComponent().number;

Then you can access the number variable for the ball from any gameObject!

If you found this answer useful, please award me with reputation!