Preserve wheelspin during teleport...

Discussion in 'Programming' started by emlodnaor, May 28, 2025 at 1:02 AM.

  1. emlodnaor

    emlodnaor
    Expand Collapse

    Joined:
    Apr 24, 2022
    Messages:
    12
    Does anyone know how to preserve wheelspin during teleport?

    I'm working on a mod where I need to teleport the player somewhat frequently, and I found a bug(?) in
    veh:setPositionNoPhysicsReset(pos)
    in that it resets some of the physics, at least the wheel spin.
    I've also tried using
    veh:setClusterPosRelRot(veh:getRefNodeId(), newPosX, newPosY, newPosZ, diffRot.x, diffRot.y, diffRot.z, diffRot.w)
    with the same results...

    Maybe it's intentional, but I'm using it together with
    veh:applyClusterVelocityScaleAdd(...)
    and need the player to keep wheelspin and velocity...

    I've tried to work around this by using
    obj:setWheelTorqueAndBrakeTorque(i, 100000, 0) (vehicle lua)
    but is does not do anything unless I first call
    obj:getWheelFFI(i)
    but as soon as I do, it locks up that wheel in some way, and it seems to not be intended to be used it that way...

    any help or pointers would be appreciated!
     
  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