Predicament with GetPlayerCameraFrontVector
#1

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.
Reply
#2

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...
Reply
#3

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

Rep +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)