Unsolved World coordinates in vehicle lua?

Discussion in 'Mod Support' started by Solid_Granite, Jan 27, 2018.

  1. Solid_Granite

    Solid_Granite
    Expand Collapse

    Joined:
    Nov 25, 2017
    Messages:
    27
    Is it possible to input the car's position as X Y Z coordinates, in the vehicle's lua? i.e where it is on the map?

    thanks in advance
     
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    Code:
    local pos = obj:getPosition()
    This will get the current position of the car using world coordinates
    pos is a table(userdata) like {x = 0.0, y = 0.0, z = 0.0}

    If you want to "set" it you will need to reset to vehicle using ge/spawn.lua
     
  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