Code Monkey home page Code Monkey logo

Comments (5)

highwaywarrior0 avatar highwaywarrior0 commented on May 23, 2024

Apparently they are trying to go to Segment-0, but why?

https://streamable.com/teiuwz

from unity-traffic-simulation.

mchrbn avatar mchrbn commented on May 23, 2024

It could be because of the starting position of your cars - at the start, the system tries to get the closest front waypoint from the car in order to automatically define where the car has to go. But if the waypoint is very far away, it could pick the wrong one.

I can see from your video that you have very long straight segments without any waypoints in between, maybe that could be the issue?

It seems that some cars are driving properly, could you check if these ones are positioned close to a waypoint at the start? And if the one who are driving wrong seem very far away from a waypoint?

from unity-traffic-simulation.

highwaywarrior0 avatar highwaywarrior0 commented on May 23, 2024

Yeah it's completely related to the starting position i think.

If you look at the areas where the problem occurs most, they are bends, where most of the waypoints are located.

And, opposite to what you said, these happen when the cars are too close to waypoints, not because they are too far away.
When I move the broken cars away from any waypoint they start driving normally.

Also I tested if it's related to closest waypoint being in front/back of the car too, and no it isn't.

https://streamable.com/tbgapm

from unity-traffic-simulation.

mchrbn avatar mchrbn commented on May 23, 2024

Mhh did you try to change the value of "Segment Detection Threshold" on the "Traffic System" gameobject? If not, try to increase the threshold a bit.

If this still doesn't work, you can upload your project somewhere so I can have a look.

from unity-traffic-simulation.

highwaywarrior0 avatar highwaywarrior0 commented on May 23, 2024

I increased it from "0.1" to "2" and now everything seems to be working properly, thanks

from unity-traffic-simulation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.