//d3d_point_direction_z(x,y,z,x2,y2,z2); //Remember to replace this in this way to get a full working function... //x = argument0 //y = argument1 //z = argument2 //x2= argument3 //y2= argument4 //z2= argument5 //This returns the drection on the second direction... return (point_direction (0,argument2,point_distance(argument0,argument1, argument3,argument4),argument5));
So I used this in the step event
if d3d_point_direction_z(objTarget.x,objTarget.y,objTarget.z,x,y,pitch) objFPS.Subimage=1 else objFPS.Subimage=0
Heres the cameras draw event
bearing -= (display_mouse_get_x() -display_get_width()/2)/10; pitch += (display_mouse_get_y() -display_get_height()/2)/10; pitch = max(min(pitch,80),-80); //this limits camera pitch -is up, + is down ss = sin(degtorad(bearing));cc = cos(degtorad(bearing)); vector_x=cc*cos(degtorad(-pitch)); vector_y=ss*-cos(degtorad(-pitch)); vector_z=sin(degtorad(-pitch)); BobAngle=(BobAngle+360+speed *2 ) mod 360 BobZ=(zfrom+lengthdir_x(0.1,BobAngle))+120 d3d_set_projection_ext(x,y,BobZ,x+vector_x,y+vector_y,BobZ+vector_z,0 ,0,1,45,1.33,1,32000) draw_set_color(c_white); display_mouse_set(display_get_width()/2,display_get_height()/2);
The result was kind of weird as the cross turns red at random times and thats not what its supposed to do so some please help me if you need anymore information please tell me and I know TGG has an example on Shooting Bullets which is kind of similar to this but his code doesnt work in my game cause its coded differently
NOTE:MOST OF THE CODES ARE FROM XYGTHOP3
Thanks



Find content
Not Telling
