Unity3d Racing Game Closing Roads

Goodmorning everyone,
I have a City Road System, I am using RainOne for Enemy AI.
Now I need to make when a enemy see you in the range it comes near to you, and gui will be enabled, where you can choose a destination.
So from here start the race, but I need to close the road too, I mean to make the player don’t going from another road.
How can i do an Instantiation of this kind, What i have to do?
Any suggestions?
Thanks everyone, have a nice day!

I’m having trouble understanding you but what I think you need is at least one script with:

  1. A function that can turn the GUI on and off/hide and show.
  2. In the Update method check the distance to all the AI characters to your player charafcter. If the distance is close then call the function to turn the GUI on. If nothing is close turn it off. This should be fine as long as you don’t have too many AIs in the level (eg < 50). You can also use the LookAt function to make your camera look at this AI guy.
  3. Perhaps invisible walls can stop the player leaving the track?

Right, I am able to do the first 2, but the last 3 i don’t know anythink!!!

  1. Just get a box with a collider on it and disable the mesh renderer.

but my problem is that, since I have a city road system, (for example, the need for speed most wanted’s circuit race system) i don’t know where to put this collider, i mean the position.
I was thinking to create programmatically a spline extruded which should work like a collider at the border of the road. But I don’t know how to do…
we need to create a mesh programmatically. do you have any idea? Thanks. take care

Why cant you just create loads of collider objects to go around the track? Is it too big to do by hand or…?

Can you show a picture of your track?