function getPositionFromElementOffset(element,offX,offY,offZ)
local m = getElementMatrix (element)
local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1]
local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2]
local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3]
return x, y, z
end
addEventHandler("onClientRender", getRootElement(),
function()
local x,y,z = getPositionFromElementOffset(localPlayer, 0.5, -3, 0.5)
setCameraMatrix(x, y, z, x, y, z)
end
)
I have this. works fine as i said, but if i press D for example when im standing, the camera doesnt follow the players rotation to the angle, and idk which part of the matrix is supposed to do that.