Jump to content

getCameraMatrix


BulleTTime

Recommended Posts

I'm trying to make a function were the camera moves from 1 point to another.

I noticed it needs a player arg, but im still getting a nil value though

ERROR: ...script.lua:97: attempt to perform arithmetic on local 'pos2z' (a nil value)

  
local x,y,z = getElementPosition(player) 
local cx, cy, cz, lx, ly, lz = getCameraMatrix(player) 
  
cameraMovement(x,y,z+start_z,cx,cy,cz,x,y,z,player) 
  
function cameraMovement(pos1x,pos1y,pos1z,pos2x,pos2y,pos2z,pointx,pointy,pointz,player) 
local pos1z = pos1z - 0.3 
  
if pos1z - pos2z >0 then 
setTimer ( cameraMovement, 100, 1, pos1x,pos1y,pos1z,pos2x,pos2y,pos2z,pointx,pointy,pointz,player) 
else 
setCameraMode (player, "player")  
end 
  
setCameraMatrix(player, pos1x,pos1y,pos1z,pointx,pointy,pointz) 
end 

Link to comment
I'm trying to make a function were the camera moves from 1 point to another.

I noticed it needs a player arg, but im still getting a nil value though

ERROR: ...script.lua:97: attempt to perform arithmetic on local 'pos2z' (a nil value)

...

The error basically says pos2z is nil. Check your code where it was assigned a value and make sure it's a number. We can't see when pos2z is assigned a value so we can't tell you why you get an error.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...