Camera
#1

I use InterpolateCameraPos / LookAt, but when the timer is called this Interpolate camera position does not remove. And whenever i move my mouse to any way camera will go behind the player. I won't spawn player, I just want him to be there when he used cmd in isplayerinrangeofpoint.

Example:

Код:
CMD:camera(playerid)
{
    InterpolateCameraPos(playerid, 221.893768, 1822.836059, 11.279774, 220.261932, 1822.938842, 10.925539, 2000);
				InterpolateCameraLookAt(playerid, 217.278533, 1823.135986, 9.379850, 219.826156, 1822.940917, 5.944565, 3000);
SetTimerEx("Unstuck", 2000, false, "i", playerid);
Код:
forward Unstuck(playerid);
public Unstuck(playerid)
{
	TogglePlayerSpectating(playerid, 0);
              SetCameraBehindPlayer(playerid);
	return 1;
}
+REP for a guy who find the solution.
Reply
#2

I've just tested the code you posted and it works perfectly fine for me. Something else must be wrong.
Reply
#3

Quote:
Originally Posted by Daveosss
Посмотреть сообщение
I've just tested the code you posted and it works perfectly fine for me. Something else must be wrong.
Of course it works, but the problem is camera is always behind the player as i doesn't remove and i can't move proper, it's shaking.. Try to move and you'll see.
Reply
#4

I had tried and none of that happened, is there anything else in the /camera command?
Reply
#5

Just a single check IsPlayerInRangeOfPoint, nothing else.
Reply
#6

SetCameraBehindPlayer shouldn't be necessary if you're disabling spectating anyway. I assume you've put the player in spectate mode to hide the HUD? If so just turning it off should respawn the player.

Try adding debug messages to your code so you have an idea of what's happening and when.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)