Hey
Firstly the Bullet Collision in my first person shooter is working prefectly, hits wall, players and enemies with very little error. At this time i had my object moving 20 every loop, which is quite slow for a bullet.
So i changed the figure to a more realistic speed (i tried 100-200)
but now my collision doesnt work
My theory is that since the bullet is moving at a high rate its going through walls and enemies before collision has time to take effect. At least thats what i think
So basiclly what i need is a solution that will allow me to have both good collision + a high speed bullet.
Heres my Collision code
_bullet_to_wall_collision:
radius#=10.0
bcx# = object position x(200)
bcy# = object position y(200)
bcz# = object position z(200)
for x=0 to checks-1
chx#=newxvalue(bcx#,x*angwidth,1)
chz#=newzvalue(bcz#,x*angwidth,1)
ang#(x,1)=intersect object(1,bcx#,bcy#,bcz#,chx#,bcy#,chz#)
if ang#(x,1)=0 then ang#(x,1)=999999
ang#(x,2)=x*angwidth
sort#(x,1)=ang#(x,1)
sort#(x,2)=ang#(x,2)
next x
for x=0 to checks-2
for y=x+1 to checks-1
if ang#(x,1)>ang#(y,1)
temp#=ang#(x,1)
temp2#=ang#(x,2)
ang#(x,1)=ang#(y,1)
ang#(x,2)=ang#(y,2)
ang#(y,1)=temp#
ang#(y,2)=temp2#
endif
next x
next y
prev=wrapvalue(ang#(0,2)-90)/angwidth
nxt=wrapvalue(ang#(0,2)+90)/angwidth
newd#=radius#-ang#(0,1)
newa#=wrapvalue(ang#(0,2)-180)
newd1#=radius#-sort#(prev,1)
newa1#=wrapvalue(sort#(prev,2)-180)
newd2#=radius#-sort#(nxt,1)
newa2#=wrapvalue(sort#(nxt,2)-180)
`if you are less than radius from a wall, push you out to 20 from it
if ang#(0,1)0.0
fireallow = 0
bulletlife = 1
endif
return
and heres my bullet code, its pretty simple code
if fireallow = 0
position object 200,camera position x(),cy#+76,camera position z()
endif
if mouseclick()=1 and bulletlife = 1
fireallow = 1
set object to camera orientation 200
endif
if fireallow = 1
show object 200
bulletlife = 0
move object 200,20
endif
Return