Joey;In my code the camera is attatched to the box pivot called p_pivot (short for player pivot) in the line p_cam=CreateCamera(p_pivot).
Then its z position is updated right before the cls command.
If MouseZSpeed()<>0 Then
speed#=(MouseZ()+MouseZSpeed())*.1
EndIf
MoveEntity p_pivot,0,0,speed# ;HERE
cls
In this line
If MouseZSpeed()<>0 Then
Is the z mouse button being turned? MouseZSpeed() will return a value greater that 0 for forword movement and less than 0 for backward movement.
and then this line,
speed#=(MouseZ()+MouseZSpeed())*.1
sets the float variable speed# to how far the mouse z button has bin rotated.
MouseZ() the mouses initial starting position.
MouseZSpeed() can be + or - infinity. Now because leaving it speed#=(MouseZ()+MouseZSpeed()) (without the *.1) results in a moving to fast I multiply it by .1 so the camera will move only 1/10
the value of Mousezspeed().
Then its z position is updated right before the cls command.
If MouseZSpeed()<>0 Then
speed#=(MouseZ()+MouseZSpeed())*.1
EndIf
MoveEntity p_pivot,0,0,speed# ;HERE
cls
In this line
If MouseZSpeed()<>0 Then
Is the z mouse button being turned? MouseZSpeed() will return a value greater that 0 for forword movement and less than 0 for backward movement.
and then this line,
speed#=(MouseZ()+MouseZSpeed())*.1
sets the float variable speed# to how far the mouse z button has bin rotated.
MouseZ() the mouses initial starting position.
MouseZSpeed() can be + or - infinity. Now because leaving it speed#=(MouseZ()+MouseZSpeed()) (without the *.1) results in a moving to fast I multiply it by .1 so the camera will move only 1/10
the value of Mousezspeed().