25.12.2014, 10:17
(
Последний раз редактировалось SilentSoul; 25.12.2014 в 11:46.
)
Hello, i am trying to create a dynamic canon system, it rotates with your screen movement by using GetPlayerCameraFrontVector and SetDynamicObjectRot and i am using a timer to update it, it works pretty fine, but my problem now how to detect where the object is looking at to create explosions or missiles.
EDIT: Fixed, i have the calculated the player camera postion with camera front vector together, then i multiplied them by the distance i wanted. it works fine.
EDIT: Fixed, i have the calculated the player camera postion with camera front vector together, then i multiplied them by the distance i wanted. it works fine.
pawn Код:
new
Float:x,Float:y,Float:z,
Float:x2,Float:y2,Float:z2;
GetPlayerCameraPos(playerid, x,y,z);
GetPlayerCameraFrontVector(playerid, x2,y2,z2);
CreateExplosion(x+x2*20, y+y2*20, z+z2*20, 3, 5.0);//note *20 is the distance