I need help making a City with Car moving around a certain speed, Stopping at lights, responing quite basically to Signs etc.
what you are looking for is AI
follow a path, and pick up on markers that tell the car what is ahead of him or lights or whatever.
how to do it, it depends on you. I would program it in such a way that he passes through triggers and those triggers tell him that he is approaching a light. The trigger then sets a variable in the script to tell the vehicle which light he should watch, and if it turns yellow, sipmly do a calculation to see if he can make it through it without it turning red. If not, come to a stop at it, without hitting anyone. When it turns green, follow the flow of traffic
He would also need to see what is going on around him, so shoot a ray out ahead of him at a random angle and see if he can see any vehicles that are in his way, Check their velocities against his via a Dot and if they are moveing faster or slower than him. respond accordingly.
What would be an ideal code?
There is no ideal code it’s all up to what you think is needed to make it work. But it looks to me you don’t have any idea where to start, so maybe this helps
http://www.gotow.net/andrew/blog/?page_id=78
It’s a tutorial that explains how to code a car, and implement AI with waypoints. It’s not the complete sollution you’re looking for but what do you expect. You need to start somewhere to find out about different approaches.
Could Edy’s Vehicle Physics work?
What code would work?
/facepalm
Try to read and understand previous posts again, you might learn something instead of keep asking the same question.
Edy’s code is a vehicle simulator, not AI, so no, Edy’s code will not stop at stop lights.
Unity is not a “plug and play” system. You have to know how to work things. If you do not, start at the basics, don’t start at Programming 505 without bothering to start at Programming 101