Ok there is some code below that kind of works but seems to be a little messed up. Please tell me whats wrong!!
It is supposed to have the camera following a first person gun. It works fine when you are not moving or are just turning left and right (not pressing up or down arrow keys). However when you press the up arrow key the gun zooms out infront, then slows to its normal pace. When you release the up key the gun falls back to its original position.
When you press the down arrow key the camera turns to face the end of the gun...
Here is the code:
sync on : sync rate 60 : autocam off
make matrix 1,1000,1000,32,32
s#=1
r#=2
rem level 1
loadgun("colt.3ds")
position object 1, 1.5, 5, 0.5
do
set camera to follow 0,object position x(1),object position y(1),object position z(1),object angle y(1),3,1,10,0
if upkey() then move object 1,s#
if downkey() then move object 1,-s#
if leftkey() then yrotate object 1,wrapvalue(object angle y(1)-r#)
if rightkey() then yrotate object 1,wrapvalue(object angle y(1)+r#)
sync
loop
rem functions
function loadgun(gun$)
load object gun$, 1
scale object 1, 400, 400, 400
endfunction
Here are some screenshots:
1. Normal, using left and right arrow keys, works fine:
2. While pressing up arrow key
3. While pressing down arrow key