It tears because at one time you affect mangle# with mousex() (when ctrlkey=1) and at another time you force mangle# to suddenly become the object y angle.
You should base all your conditions on affecting the player y angle
you should do something along these lines:
if ctrlkey=1
mymousex=mousemovex()
if mymousex>0 then playeryangle#=wrapvalue(playeryangle#+1,0)
if mymousex<0 then playeryangle#=wrapvalue(playeryangle#-1,0)
endif
if ctrlkey=0
if leftkey()=1 then playeryangle#=wrapvalue(playeryangle#-1,0)
if rightkey()=1 then playeryangle#=wrapvalue(playeryangle#+1,0)
endif
yrotate player to playeryangle#
- set camera to follow player -
my 2 cents