Question by
nosferatumnick · Jun 19, 2018 at 08:42 PM ·
unity 52d
Detect first three objects in race
Hello! I`m working on 2D race game, and I have 10 cars in race. How can I detect first three cars? Cars moving in one direction by X axis. Thank You!
Comment
Answer by tormentoarmagedoom · Jun 19, 2018 at 08:59 PM
Good day.
You only need to know the transform.position.x of each car. and when it reaches the race distance, it means has arrived.
Then store it in a GameObject variable.