Sensor on a train that detects a specific object as it passes over it

Hello everyone!

I am working on a train game and I need help. I would like to know how to make a sensor for a train that detects a specific part.

For example: when the train sensor passes over the part a light changes.

Thanks.

1 Like

Maybe make a hitbox ( transparent, can collide false ) right under the train ( between the rail and the train ). When the hitbox is touched, check if it’s the specific part, if it is, change the light.

1 Like

you could use raycasting

2 Likes