The example below is how I generally go about this.
// use the wasd keys or the onscreen joystick to rotate the cone
// hold the space bar and use the arrow keys to move the cone (or the on screen button and the joystick)
// a red sphere will be placed on the tip of the cone no matter the cone's orientation
// make a green cone and position it
CreateObjectCone(1,40,30,20)
SetObjectColor(1,0,255,0,255)
SetObjectPosition(1,0,70,0)
// create a red sphere
CreateObjectSphere(2,10,20,20)
SetObjectColor(2,255,0,0,255)
// create plane and rotate it to make a floor
CreateObjectPlane(3,500,500)
SetObjectRotation(3,90,0,0)
// position and orientate camera
SetCameraPosition(1,0,150,-200)
SetCameraLookAt(1,0,70,0,0)
do
// get player input
joystick_x = GetJoystickX()
joystick_y = GetJoystickY()
// rotatet the cone based on player input
if GetButtonState(1) = 0
RotateObjectLocalZ(1,joystick_x)
RotateObjectLocalX(1,joystick_y)
else
MoveObjectLocalX(1,joystick_x*2)
MoveObjectLocalZ(1,joystick_y*-2)
endif
// position the red sphere at the tip of the cone
SetobjectPosition(2,GetObjectX(1),GetObjectY(1),GetObjectZ(1)) //position sphere at the same coordinates as the cone
SetObjectRotation(2,GetObjectAngleX(1),GetObjectAngleY(1),GetObjectAngleZ(1)) //orientate the angle the sphere to match the cone
MoveObjectLocalY(2,20) //move the sphere to the tip of the cone
print("wasd to rotate cone")
print("hold spacebar and wasd to move cone")
sync()
loop
Instead of the cone you need to get the position and angle of the camera.
Hopefully it makes sense.