mchrbn / unity-traffic-simulation

A Unity asset that lets you easily simulate very simple traffic into your scene.
263 stars 57 forks source link

Vehicles collides with waypoint #10

Closed LeMuitque closed 3 years ago

LeMuitque commented 4 years ago

Hello!

Thank you for sharing such a great sytem. I've been trying to implement it on my project and I have only one issue. When a vehicle approach a waypoint it create a collision, yet every parameters with your demo version are the same. I've tried nearly everything but it's still doesn't seems to work. Layers and tags are set, colliders are also set on vehicles and waypoints,

I'm using last version of your code and last version of Unity, thx for your help!

MSchmoecker commented 4 years ago

This is because of the collider for the waypoint is set at the "UnityEditor" (10th) layer. You need to exclude them from the Layer Collision Matrix in the Project Settings under Physics. I’m sorry for not editing the documentation.

Set it like this: grafik

I find the solution with not very clean, I will probably try to make it work without colliders and instead calculate the intersection with the ray.

I hope I could help you

LeMuitque commented 4 years ago

Thank you so much that solved the issue and everything works perfectly now. Really appreciated!

LeMuitque commented 4 years ago

Hey! Sorry to re-open this issue. Well I'm having some difficulties with speed settings, tried to play with all parameters but I can't really understand which one is for. My issue is that acceleration is way too low. Base speed is like perfect but once my car turn or stop it takes a lot of time to get back to a normal speed.. Some hints on how to play with parameters could be very useful. Thx!

mchrbn commented 3 years ago

New update should be more comprehensive for speed (add more torque)