Thanks TDK, i use your site as one of my main sources for learning DarkBASIC, but in this case i really want to build off my formula instead of changing it completely.
I made some progress, but there's still a problem, when the camera reaches the side of the object, the screen goes white. Here is my new code:
MoveCamera:
position camera object position X(1)+mousexv,object position y(1)+70,object position z(1)-sqrt(zposcam)
point camera x#,y#+30,z#
mousexv=mousexv+mousemovex()
zposcam=350^2-mousexv^2
return
and also, since i'm <15, my maths knowledge isn't so great, so here's an explanation of how i got "zposcam=350^2-mousexv^2".
x^2+y^2=r^2
x^2+z^2=r^2
x^2+z^2=350^2
mousemovex^2+zposcam^2=350^2
zposcam=350^2-mousemovex^2
x^2+y^2=r^2 is the formula for a circle on a grid in case i didn't write it clearly enough