SetCameraBehindPlayer coordinates
#1

Does anyone have a function to return SetCameraBehindPlayer's coordinates accurately?
I basically want to detect these coordinates without settings the camera behind the player.

Cheers
Reply
#2

Quote:
Originally Posted by ranme15
Посмотреть сообщение
Does anyone have a function to return SetCameraBehindPlayer's coordinates accurately?
I basically want to detect these coordinates without settings the camera behind the player.

Cheers
Just make a function like

Код:
new Float:Coords[3];
then take the coords by this float

Код:
GetPlayerCameraPos(playerid, Coords[0], Coords[1], Coords[2]);
Do that before the SetCameraBehindPlayer, and then do what you want with the Coords
Reply
#3

Quote:
Originally Posted by Davidmkd123
Посмотреть сообщение
Just make a function like

Код:
new Float:Coords[3];
then take the coords by this float

Код:
GetPlayerCameraPos(playerid, Coords[0], Coords[1], Coords[2]);
Do that before the SetCameraBehindPlayer, and then do what you want with the Coords
If you don't know what im talking about, please avoid commenting.
Reply
#4

He is almost right. Call SetCameraBehindPlayer, wait for syncing and then get the coords of the camera.

That will give you the exact coords of the camera when doing SetCameraBehindPlayer.
Then calculate the X/Y distance between player and that position and when setting the cam, get the facing angle and add this offset in the opposite direction (GetXYInFrontOfPlayer).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)