Search Unity

Line/Path following vehicle

Discussion in 'Physics' started by k2108, Dec 18, 2018.

  1. k2108

    k2108

    Joined:
    Oct 8, 2018
    Posts:
    2
    Hello everyone,

    I have to make a semi-autonomous vehicle, which mostly follows the kerb/line to navigate, but at times should be manually controlled as well.

    Any suggestion related to the currently available model or logic to create my own vehicle controller will help?

    Thanks
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    You can take the position of the vehicle and the 'kerb' in FixedUpdate().

    Then apply forcemode.impulse until it's back within the range. (you might want a cooldown timer on the force. idk)
     
    k2108 likes this.
  3. NukeEnjoyer

    NukeEnjoyer

    Joined:
    Jul 24, 2017
    Posts:
    6
    there is an example vehicle project in Unity Standart Assets which contains AI, Manual Controller, and Waypoints. you can copy/edit their Scripts.
     
    k2108 likes this.