Function aims to get side of matrix co-ordinations (in this case player co-ords). Should return a modified X,Y,Z to get the side of the player, instead returns nil.
function getSideOfPlayer()
local x,y,z = getElementPosition(localPlayer)
local z = getGroundPosition(x,y,z)
local rX, rY, rZ = getElementRotation(localPlayer)
local eMatrix = (Matrix.create(x,y,z,rX,rY,rZ))
return (Matrix.getPosition(eMatrix) + Matrix.getRight(eMatrix)*math.random(3)) -- Random slight reposition to the right side of the player.
end
Function is called by another function and stored in only three variables as follows:
local x,y,z = getSideOfPlayer()
Why is it returning nil instead of actual co-ordinates?
Thanks.