If you want a straight flying bullet you can use this formulas:
Code: Select all
If ExamineMouse()
MouseX = -MouseDeltaX()/2
MouseY = -MouseDeltaY()/2
CameraDirectionX+MouseX
CameraDirectionY+MouseY
If MouseButton(1) ; left MouseButton (nervous trigger finger ;)
; get the start coordinates
LocateX=CameraX(#YourCam)
LocateY=CameraY(#YourCam)
LocateZ=CameraZ(#YourCam)
; and calculate the deltaXYZ coordinate just one time!
deltaY= gcos(CameraDirectionX) * gcos(CameraDirectionY) * Speed
deltaX=-gsin(CameraDirectionX) * gcos(CameraDirectionY) * Speed
deltaZ= gsin(CameraDirectionY) * Speed
Endif
Endif
Code: Select all
If active
LocateX + deltaX
LocateY + deltaY
LocateZ + deltaZ
EntityLocate(#bullet,LocateX,LocateY,LocateZ)
EndIf
RotateCamera(#YourCam, MouseX, MouseY,0)
RenderWorld()

I hope this is understandable.
MFG
WolfgangS