SetPlayerCameraPos
#1

Can someone please tell me which float controls the distance between the camera and "character"?

Код:
	SetPlayerPos(playerid, 15.304734, 2418.625976, 32.578125);
	SetPlayerFacingAngle(playerid, 112.558120);
	SetPlayerCameraLookAt(playerid, 15.304734, 2418.625976, 32.578125);
	SetPlayerCameraPos(playerid, 15.304734 + (10 * floatsin(-112.558120, degrees)), 2418.625976 + (10 * floatcos(-112.558120, degrees)), 34);
Reply
#2

It's easy mate, SetPlayerPos is to set the player's location/position to XYZ co-ordinates, SetPlayerCameraPos is exactly the same but then it's the camera's (screen) location/position.. so those two are the answer on your question, have a nice day further.
Reply
#3

Ahh okay, so 10 is the distance, cheers
Reply
#4

No, i didn't said that.. I'll give you an example:
If the player's pos is X: 1500 Y: 700 Z: 20
and the player's camera is X: 1550 Y: 710 Z: 20
Then the distances are:
X: 1550 - 1500 = 50 difference
Y: 710 - 700 = 10 difference
Z: 20 - 20 = 0 difference
The distance between the player and camera is 50 X, 10 Y. (Correct me if i'm wrong bcoz im kinda tired.)
Reply
#5

Well anyway i changed the "10"-values in:
Код:
	SetPlayerCameraPos(playerid, 15.304734 + (10 * floatsin(-112.558120, degrees)), 2418.625976 + (10 * floatcos(-112.558120, degrees)), 34);
So it worked out, don't really know what you're saying man :/
Reply
#6

Lol, not my problem.. You should explain clear what you wanted, i thought you wanted the distance between camera and player..
Reply
#7

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Lol, not my problem.. You should explain clear what you wanted, i thought you wanted the distance between camera and player..
Exactly, that controls the distance between the player and the camera.
Reply
#8

There is no way to "control the distance", you can set the camera position, and the player position, but not the distance.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)