SA-MP Forums Archive
Predicament with GetPlayerCameraFrontVector - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Predicament with GetPlayerCameraFrontVector (/showthread.php?tid=270939)



Predicament with GetPlayerCameraFrontVector - Celson - 22.07.2011

Does this function only work while you are aiming?

Because I have something very basic as this in my script...

pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerCameraFrontVector(playerid,X,Y,Z);
MoveObject(ball,X,Y,Z,10.0);
And all it seems to do is move the object 'ball' in one direction. I had assumed that would make the ball move where my camera was facing.


Re: Predicament with GetPlayerCameraFrontVector - iPLEOMAX - 22.07.2011

GetPlayerCameraFrontVector doesn't give you the exact position to which you are looking at, it only gives "directions" AFAIK.

So, you need to combine cam pos and other to get the X,Y,Z World Coordinate that you want.

Take a look at this: GetPlayerCameraFrontVector

^ If you want to move an object to which your cam is looking at, then Instead of CreateObject use MoveObject to object_x, object_y & object_z...


Re: Predicament with GetPlayerCameraFrontVector - Celson - 22.07.2011

Ahh right. Makes a bit more sense to me now.

Rep +