As you can see in my code snippet I have made a mouselook and the camera follows the object. If I rem out 'set object to camera orientation' the object will not change it's orientation.
So this command suits me, except that I do not want the player to fly even when 'look up'
rem camera follows the player object
position camera 0, plyPosX, plyPosY, plyPosZ
rem mouse look with restricted look in the x angle
cx#=camera angle x(0) : cy#=camera angle y(0)
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
rem sets the object to face where the camera is facing
set object to camera orientation plyObj
rem control player object using w,s,d,a
if KEYSTATE(17) then move object plyObj,1
if KEYSTATE(31) then move object plyObj,-1
if KEYSTATE(32) then move object right plyObj,1
if KEYSTATE(30) then move object left plyObj,1
Anyone knows how I can correct this problem?
Best regards
www.memblockgames.com