8 lines
166 B
Plaintext

function getLocalVelocity(entity)
if not entity:isValid() then
return
end
return entity:worldToLocal(entity:getVelocity() + entity:getPos())
end