Only one AI following me

Discussion in 'Programming' started by Sion1501, Nov 24, 2024.

  1. Sion1501

    Sion1501
    Expand Collapse

    Joined:
    Nov 24, 2024
    Messages:
    4
    Hey,
    So i am triyng to make only one AI car follow me instead of all cars, wich is possible trough the menu.
    The only Option there to my info is to make all cars follow you, but is it possible to make only one follow you?
     
  2. Ananel81

    Ananel81
    Expand Collapse

    Joined:
    Sep 7, 2021
    Messages:
    1,280
    Not until we get an AI update, something that devs have been putting aside for 10 years.
     
  3. Sion1501

    Sion1501
    Expand Collapse

    Joined:
    Nov 24, 2024
    Messages:
    4
    Are you shure that it isnt possible by write the correct code in the BeamNG drive console? Because if this is possible what would be the correct code?
     
  4. whatawhat

    whatawhat
    Expand Collapse

    Joined:
    May 25, 2018
    Messages:
    399
    You can do this with the AI Control UI app. Switch to the vehicle you want to follow you, and set it's mode to Follow
     
  5. MegaKnight

    MegaKnight
    Expand Collapse

    Joined:
    Sep 12, 2024
    Messages:
    218
    I've done a similar thing multiple times:
    1. Spawn two vehicles from the vehicle selector
    2. Set the AI in radial menu to Follow Mode - now the other car will follow you
    3. Spawn traffic via the radial menu - they will drive normally, while the other car keeps following you
    I did that in 0.32 the last time, so it might not work anymore. Also, I did it with Flee/Chase Mode, but it should work with Follow Mode as well.
     
  6. r3eckon

    r3eckon
    Expand Collapse

    Joined:
    Jun 15, 2013
    Messages:
    595
    You can do it manually with console using two commands:
    Code:
    ai.setTargetObjectID(12345)
    ai.setMode("follow")
    Replace 12345 with the ID of your vehicle (or any vehicle you want to get followed) then execute both lines on the vehicles you want to have following the other vehicle.
    Use the console dropdown menu to select the correct car and see the vehicle IDs you need to use.

    upload_2024-11-24_16-57-53.png
     
  7. Sion1501

    Sion1501
    Expand Collapse

    Joined:
    Nov 24, 2024
    Messages:
    4
    Thank you so much
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice