Search Unity

Traffic light system for beginner

Discussion in 'Scripting' started by Silveralby, Feb 15, 2018.

  1. Silveralby

    Silveralby

    Joined:
    Jan 14, 2018
    Posts:
    81
    Hy guy I do not know the scripts but I would like to be able to create a system where AI cars are controlled by a traffic light. I use the asset road architect master where a traffic light system is already present. Is there anyone available to explain the first steps to check a car with the traffic lights? Thanks
     
  2. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    How much experience do you have with coding out of curiosity? I think perhaps the way I'd do it is I'd put in a sphere collider at each traffic light point with trigger activated and then I would make a public variable which indicates what colour the light is and use Navmesh agents to dictate when the cars stop or go.

    Be sure to check out how to do waypoints for the agents, I'm not sure how well this would work though if you're dealing with vehicles but the principle is a bit more simpler than most realise where you have the waypoints placed at the traffic lights and the traffic light junctions.
     
  3. Silveralby

    Silveralby

    Joined:
    Jan 14, 2018
    Posts:
    81
    Thanks for the answer Lethn. Unfortunately I have no experience with the scripts and I was wondering if there was anyone available to create it for me. Regarding to create the path and the trigger I have no problems, however, I would like to know if the script should be inserted in the AI car or somewhere else.
     
  4. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    I think there are other places you can try to get people to write scripts for you. This forum is for people that actually want help with writing their scripts. You probably weren't told that, I'm sure, and made an honest mistake.
     
  5. Silveralby

    Silveralby

    Joined:
    Jan 14, 2018
    Posts:
    81
    Hi fire7side I'm sorry for having the wrong forum. Can you direct me where I can find a forum where people are available to help me? Thanks
     
  6. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Learn coding for Unity in C#, or hire someone to do the coding for you.
     
  8. Silveralby

    Silveralby

    Joined:
    Jan 14, 2018
    Posts:
    81
    Joe in fact I'm looking for someone who has a passion for C # and who wants to help those who do not know him.
     
  9. Lethn

    Lethn

    Joined:
    May 18, 2015
    Posts:
    1,583
    No one is going to do that sort of thing for you for free if that's what you're expecting, you're pretty much assigning them work.
     
    Joe-Censored and pli like this.
  10. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    Just about everyone that learns Unity is thinking about making their own game, or already making their own game. They stop in here to learn or offer advice. Sometimes they will pair up with someone that is a good modeler or artist, but that's about it. They used to have a forum for setting up teams but they got rid of it, so there isn't anything like that on these forums anymore. Even if you get someone to write this script for you, it will just happen again. You can take a look at a Unity Playmaker, which makes coding much easier.
     
  11. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    People on the forums here do like to help when you run into a problem that you are stuck on. If you're not willing to learn coding yourself, there isn't much anyone can help you with. Any complete game is going to require a lot of coding, so if you are having someone else do it you're going to need a long term commitment. That's not what the help on the forum is for.

    You wouldn't go to a car forum, say you need a new brake system on your car, but you don't want help with doing it yourself, instead you want someone else to do it for you for free, and most likely every other car problem you ever run into in the future.... but you're effectively doing the same thing here.