Hey all, I have an issue with my camera rotation. I can get the camera to rotate up or down ONLY if the object also rotates up or down. This is not what effect i want, and i don't think what anyone would want. Right now the camera will move left/right without flaw, and when trying to get it to look up or down, it'll be glitchy and move slightly up, but quickly return to being set looking at the player. Can anyone look at my code to see where this may be going wrong?...
function move_stand(obj)
yrotate object 1,object angle y(1)+mousemovex()/3.0 : Move = 11 : Loop# =11
oldx# = object position x(1)
oldy# = object position y(1)
oldz# = object position z(1)
angy# = object angle y(1)
vx# = 0
vz# = 0
if vy#=0 and jumptimer=0 then vy# = vy# + 10*gravity# else vy# = vy# + gravity#
rem if keystate(32)=1 then yrotate object 1,angy#+0.5 : yrotate camera angy#+0.5
rem if keystate(30)=1 then yrotate object 1,angy#-0.5 : yrotate camera angy#-0.5
if keystate(32)=1 then vx# = vx# + cos(angy#)/4 : vz# = vz# - sin(angy#)/4 : Move = 7 : else : Move = 6
if keystate(30)=1 then vx# = vx# - cos(angy#)/4 : vz# = vz# + sin(angy#)/4 : Move = 8 : else : Move = 6
if keystate(31)=1 then vx# = vx# - sin(angy#)/4 : vz# = vz# - cos(angy#)/4 : Move = 9 : else : Move = 6
if keystate(17)=1 then vx# = vx# + sin(angy#)/4 : vz# = vz# + cos(angy#)/4 : Move = 10 : else : Move = 6
endfunction
function positionCameraToObject(obj,thirdPerson)
angy# = object angle x(1) + mousemovey()/3
Position camera 0,object position x(1),object position y(1)+9,object position z(1)
Rotate camera 0,object angle x(1)+angy#,object angle y(1),(object angle z(1))
Position object 2, Object position x(1),object position y(1),object position z(1)
Rotate object 2, object angle x(1),object angle y(1),object angle z(1)
move camera -10
if thirdPerson=1
angy# = object angle x(1) + mousemovey()/3
pitch camera up -3
move camera 4
Rotate camera 0,(object angle x(1)+angy#),object angle y(1),(object angle z(1))
else
thirdPerson=0
if Movement = 1 then move camera 6.5 : turn camera right 90 : move camera 2.5 : turn camera left 90
if Movement = 2 then move camera 6.5 : turn camera right 90 : move camera 2.5 : turn camera left 90
if Movement = 3 then move camera 6.5 : turn camera right 90 : move camera 2.5 : turn camera left 90
endif
endfunction
I have been getting so confussed about this... thanks for any help...
www.myspace.com/9thorigin
www.soundclick.com/octoberscry