@Niv
No, camera positions are definitely positions.
I don't really understand the problem you're having, place the camera in the centre of the matrix and see if it still happens.
May I suggest writing the x/z tests in a slightly different way to make it easier to follow...
newx# = Newxvalue(X#,CAY#,20)
XTest# = (0<=newx#) & (newx#<=10000)
newz# = Newzvalue(Z#,CAY#,20)
ZTest# = (0<=newz#) & (newz#<=10000)
If XTest#=1 and ZTest#=1 then move Camera 10
As you are quite new this may look really complicated, maybe I shouldn't be chucking this stuff at you just yet but meh lol.
What I've done is changed the tests to equal 1 if true; moving on that axis is allowed, or 0 if false; moving on that axis would be out of bounds. So now we have to pass both tests to be allowed to move.
You can use relational operators (=,>=,<=,<,>
to return a value. The value returned is the result of the comparison (1=true, 0=false), e.g. 5>1 so A= 5>1 would give A a value of 1 (true). In fact relational operators ALWAYS return a value whether you are storing it in a variable or not; when you type
if A>B ... you are actually asking
if A>B = 1 ... DB evaluates the expression A>B, and if it's true (A is greater than B) it returns a value of 1 which the IF statement reads as a success and so gives access to the code inside it.
IF statements always look for a true value, so we don't really need to tell them to look for it; we could type
if spacekey() ... and it would work just the same as
if spacekey()=1 .... All we are really doing by adding "=1" (apart from making it clearer to beginners) is adding another expression to evaluate, so we're asking if the state of the spacekey is equal to one, instead of just asking if the spacekey is being pressed.
& (AND) is another type of relational operator called a binary operator, along with | (OR) and ! (NOT). All three are used to compare two parameters and return a value.
! (NOT) works the same as <>, it will return 1 if the two parameters are NOT equal, or 0 if they are indeed equal. I think it works faster than <>, it's quicker to type anyway and looks better.
AND and OR work a little differently. OR returns all the bits present in either number, while AND returns only those bits which are present in both numbers. So 6&2 would return 2 because 4 is only present in 6 not 2, however 6|2 would return 6.
If I've lost you that's okay, look up "Binary Digits" (or "bits" for short) and "Binary Numbers". It's worth learning because your computer thinks in binary, and we are trying to tell it what to think.
Your memory has been erased by a mod - Your new name is Brian.