Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Games Making a car follow move along a road in its lane

Discussion in 'Projects In Progress' started by Beurnii, Dec 30, 2021.

  1. Beurnii

    Beurnii

    Joined:
    Oct 27, 2015
    Posts:
    2
    Hi!

    I am doing my first unity really project and I need a infinite road (close loop can work) where I have cars moving on it in there lane. The car are not player controlled, they simply follow the path and move at constant speed.

    For the road I have tried two solutions: Road architect or Kajaman's roads. I think ill be using road architect because I can make the road myself and closing the loop by overlapping the ends to make it close loop. However, having an overlap will probably bring issues to make cars follow the road. For Kajama's road, I could simply generate road back to back to make it infinite.

    However, for moving along the road, I don't know what to do. I found some package such as Bézier Path Creator which allow to create a path and make object follow it, but I need to create it manually and it is very tedious to do. Also it is very hard to do it smoothly enough to not see some abrupt change in direction. I don't know what else I can do. I would like to have something use the road as the path to follow. If I use a close loop road, the car needs to be able to do the loop correctly and if I generate more road at runtime, the path need to extand too.

    In a perfect world, I would like to have a asset package like road architect that allow to create real close loop road and than has something built in to make cars move in each line of the road.

    If you have any help of tip for me, please let me know!

    :)