SA-MP Forums Archive
Attached camera - 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)
+--- Thread: Attached camera (/showthread.php?tid=525214)



Attached camera - cnoopers - 10.07.2014

Camera is not moving with player, why?
Код:
	new Float:x, Float:y, Float:z;
	new cameraobject;
	GetPlayerPos(playerid, x, y, z);
	cameraobject = AttachObjectToPlayer(19300, playerid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
	
	SetPlayerCameraPos(playerid, x, y, z+10);
	SetPlayerCameraLookAt(playerid, x, y, z, 1);
	AttachCameraToObject(playerid, cameraobject);



Re: Attached camera - Tadas - 10.07.2014

I think than you have to update it every time when it moves. Try to use OnPlayerUpdate callback

EDITED:
Just put that code under OnPlayerUpdate callback.

+Rep if I helped you.


Re: Attached camera - cnoopers - 10.07.2014

now is bad too, its must be attached but its not work, idk why man


Re : Attached camera - S4t3K - 10.07.2014

You should try "PlayerSpectatePlayer" ?


Re: Attached camera - cnoopers - 10.07.2014

no because i cant spectate my character