It seems as everytime i get started with screen lockign something i alwasy end up having my object clip in the first person view! Ive uploaded the file with a test model to show you exactly what i mean. Can anyone fix the error, send it to me by email, or possibly post here whats wrong with it the position of the object? Thanks.
http://www.geocities.com/jjrgotgame/clipping.zip
and if you cant download it, then heres the code, it has some variables in it for gun bouncing. THanks.
rem first person shooter play around
rem written by Thisone
sync on
sync rate 30
autocam off
hide mouse
set ambient light 85
set camera range 1,5000
position camera 5000,5000,5000
load image "Cstexture.jpg",1
load object "pistolwhip.3ds",2
texture object 2,1
scale object 2,4,4,4
rotate object 2,270,0,75
set object collision off 2
autocam off
x_pos#=2.0
y_pos#=3.0
z_pos#=5.0
gun_x_pos_locked#=0.0
gun_y_pos_locked#=-0.5
gun_z_pos_locked#=10.0
gun_x_pos#=0.0
gun_y_pos#=0.0
position object 2,gun_x_pos#,gun_y_pos#,gun_z_pos#
lock object on 2
y_angle=0
walk_angle#=0.0
walk_speed#=0.75
main:
do
if upkey()
x_pos#=x_pos#+walk_speed#*sin(y_angle)
z_pos#=z_pos#+walk_speed#*cos(y_angle)
`this is the same as saying
`x_pos#=newxvalue(x_pos#,y_angle,walk_speed#)
`z_pos#=newzvalue(z_pos#,y_angle,walk_speed#)
walk_angle#=wrapvalue(walk_angle#+10)
else
if downkey()
x_pos#=x_pos#-walk_speed#*sin(y_angle)
z_pos#=z_pos#-walk_speed#*cos(y_angle)
walk_angle#=wrapvalue(walk_angle#-10)
else
walk_angle#=0.0
endif
endif
if leftkey()
y_angle=wrapvalue(y_angle-5)
endif
if rightkey()
y_angle=wrapvalue(y_angle+5)
endif
yrotate camera y_angle
position camera x_pos#,y_pos#,z_pos#
gun_x_pos#=gun_x_pos_locked#+sin(walk_angle#)
if walk_angle# < 90 OR walk_angle#> 270
gun_y_pos#=gun_y_pos_locked#-0.5*cos(walk_angle#)
else
gun_y_pos#=gun_y_pos_locked#+0.5*cos(walk_angle#)
endif
position object 2,gun_x_pos#,gun_y_pos#,gun_z_pos_locked#
sync
loop
end
"All creators of a game, have the true name"