function getLocalVelocity(entity) if not entity:isValid() then return end return entity:worldToLocal(entity:getVelocity() + entity:getPos()) end function calculateWheelInertia(entity) if not isValid(entity) then return Vector(0) end local originalInertia = entity:getInertia() return Vector(originalInertia) end