okay. I am going to rewrite the function that moves the shots since since it did not work I have deleted it. the movement of the character that I do is very simple
this code to move
function controla_prota()
startx# = Getobjectx(objID)
starty# = Getobjectz(objID)
mueve = 0
rem Move camera
if ( GetRawKeyState( 87 ) or GetJoysticky()<0 )
a=abs(startx#/64)
b=abs(starty#/64)+GetFrameTime()*40
if mapa[a,b] =1 then starty#= starty#+GetFrameTime()*100
mueve = 1
endif
if ( GetRawKeyState( 83 ) or GetJoysticky()>0 )
a=abs(startx#/64)
b=abs(starty#/64)-GetFrameTime()*40
if mapa[a,b] = 1 then starty#= starty#-GetFrameTime()*100//MoveCameraLocalz( 1, -0.05 )
mueve = 1
endif
if ( GetRawKeyState( 65 ) or GetJoystickx()<0 )
a=abs(startx#/64)-GetFrameTime()*40
b=abs(starty#/64)
if mapa[a,b] = 1 then startx#= startx#-GetFrameTime()*100 //
mueve = 1
endif
if ( GetRawKeyState( 68 ) or GetJoystickx()>0 )
a=abs(startx#/64)+GetFrameTime()*40
b=abs(starty#/64)
if mapa[a,b] = 1 then startx# = startx#+GetFrameTime()*100//MoveCameraLocalX( 1, 0.05 )
mueve = 1
endif
if ( GetRawKeyPressed(32) )
reinicio()
endif
endfunction
and this function repositions the camera and rotates the character pointing in the direction of the pointer
function recoloca_caracter_camara(objID)
//camara = 0
getx# = getobjectx(objID)
gety# = getobjecty(objID)
getz# = getobjectz(objID)
direcction# = ATanFull(GetScreenXFrom3D(getx#,gety#,getz#)-GetPointerX(),GetScreenyFrom3D(getx#,gety#,getz#)-getpointery())
SetObjectPosition(objID,startx#,gety#,starty#)
camara_distancia = (camara_distancia-GetRawMouseWheelDelta())
if camara_distancia < 100 then camara_distancia = 100
if camara_distancia > 550 then camara_distancia = 550
if GetRawMouseMiddlePressed() then camara_distancia = 400
SetCameraPosition(1,getx#,gety#+camara_distancia,getz#-150)
SetObjectRotation(objID,0,direcction#,0)
SetCameraLookAt(1,getx#,gety#+60,getz#,0)
endfunction
i found this https://forum.thegamecreators.com/thread/222027#msg2626744
but this uses fisycs.
As you can see I do not use physics in the game.
I used trigonometry to move the shot but frankly it had nothing to do with what I was trying
a simple orientation that guides me in the right direction I hope is enough, or a code that you have used in a similar situation without physics
very thx
using AppGameKit V2 tier 1