A couple of things. First you were updating your 'static' world which is not necessary unless you move it. Secondly you don't actually need to turn your camera 'dummy object' into a sparky's object. Just use the spheresliding commands as I have done below in your example to test for collisions between the start position and end position of your camera each loop.
sync on
sync rate 60
autocam off
hide mouse
load object "MyFirstMap.x", 2
sc_setupcomplexobject 2, 1, 5
make object sphere 1, 30
position object 1, 5, 100, 5
color object 1, RGB(0, 255, 0)
`sc_setupobject 1, 1, 2 `not needed for this kind of collision
string$ = "BAM!"
do
circle screen width() /2, screen height() /2, 10
line screen width() /2 + 15, screen height() /2 , screen width() /2 - 15, screen height() /2
line screen width() /2, screen height() /2 + 15, screen width() /2, screen height() /2 - 15
position mouse screen width() /2, screen height() /2
rem first save the original position
oldx# = object position x(1)
oldy# = object position y(1)
oldz# = object position z(1)
if mouseclick() = 1
text screen width() /2 - 14, screen height() /2 - 30, string$
endif
if keystate(17) = 1
move object 1, 3
endif
if keystate(31) = 1
move object 1, -3
endif
if keystate(30) = 1 then move object left 1, 2
if keystate(32) = 1 then move object right 1, 2
rem add simple gravity
speedY# = speedY#-1
position object 1,object position x(1),object position y(1)+speedY#,object position z(1)
rem after moving check for sliding collision
X# = object position x(1)
Y# = object position y(1)
Z# = object position z(1)
coll = sc_sphereslide(0,oldx#,oldy#,oldz#,X#,Y#,Z#,100,0)
if coll>0
rem get sliding collision position
newX# = sc_getcollisionslideX()
newY# = sc_getcollisionslideY()
newZ# = sc_getcollisionslideZ()
position object 1,newX#,newY#,newZ#
rem reset gravity up to a certain slope
nY# = sc_getcollisionnormalY()
if nY#>0.707 `about 45 degrees
speedY# = 0
`jumping
if spacekey() then speedY# = 10
endif
endif
X# = object position x(1)
Y# = object position y(1)
Z# = object position z(1)
position camera X#, Y#, Z#
CAMY# = CAMY# + mousemovex() * 0.1
CAMX# = CAMX# + mousemovey() * 0.1
if CAMX# > 90 and CAMX# < 135 then CAMX# = 90
if CAMX# > 270 and CAMX# < 225 then CAMX# = 90
yrotate camera CAMY#
xrotate camera CAMX#
yrotate object 1, CAMY#
xrotate object 1, CAMX#
rem you only need to update moving objects
`for i = 1 to 2
` sc_updateobject i
`next x
sync
loop
Hope that helps!