This is my first post. Plunging into AppGameKit and I am already stuck. Back in the DBPRO days, "shooting a bullet" (basically making a sphere fly from whatever the camera position was, to where ever the camera was *looking* was easy):
if Mouseclick()=1 and BulletLife=0
Position object 2,X#,Y#+43,Z#
Set object to camera orientation 2
BulletLife =25
Show object 2
Endif
If BulletLife > 0
Dec BulletLife
Move object 2,20
If BulletLife = 0 then Hide object 2
Endif
I quickly found trying to do this in AppGameKit was a lesson in humiliation...

The best I have been able to do is this:
// first create the bullet
CreateObjectSphere(127, 0.5, 16, 32 )
SetObjectPosition( 127, -0, 0, 5 )
Create3DPhysicsKinematicBody( 127 )
SetObjectShapeSphere( 127 )
SetObject3DPhysicsCanSleep( 127, 0 )
SetObjectCollisionMode(127,2)
// when the E key is down this starts
if GetRawKeyState(69) = 1
//make my bullet object visible
SetObjectVisible(127,1)
//move the bullet in the direction of Z only (my main problem)
MoveObjectLocalZ( 127, 0.5 )
Endif
// when the E key is up this is in effect
if GetRawKeyState(69) = 0
// the bullet is connected to my "player" the VR camera
SetObjectPosition( 127 , AGKVR.GetPlayerX(),AGKVR.GetPlayerY()+2,AGKVR.GetPlayerZ() )
// the bullet is set to invisible
SetObjectVisible(127,0)
Endif
While this works to some degree from wherever I am standing the bullet starts, but flys off in only the Z direction which I am currently using just to see if the object would move at all because there is no GetCameraDirection command or something that says, target where I am looking, or where the camera is looking... At least I can't find it if it exists. What I need is the equivalent of what "Set object to camera orientation" used to do in dbpro. Or whatever magic shizzle-whizzle that will make the bullet go to the center of the screen in the direction the camera is looking? I have been pouring over the docs but all I can find is 3 ways to move an object
MoveObjectLocalX
MoveObjectLocalY
MoveObjectLocalZ
Looking through these forums I know there is some AppGameKit ninja out there that probably knows what I'm trying to do. Can anyone out there help a nerd out?