shoot arrow

Blitz3D Forums/Blitz3D Beginners Area/shoot arrow

create a type:
type mybolt

field entityhandle

end type

then at the line "if mousehit(1)" then do this:

if mousehit(1) then
if animating(xbow)=0 then animate xbow,3
newbolt.mybolt=new mybolt
newbolt\entityhandle=copyentity(bolt)
positionentity newbolt\entityhandle,x,y,z
rotateentity newbolt\entityhandle,entitypitch(camera),entityyaw(camera),0
flushmouse
endif

then later in the code have the following:
Speed#=however fast you want them to move
for newbolt.mybolt=each mybolt
moveentity newbolt\entityhandle,0,0,Speed#
next