InterpolateCamera help
#8

First use TogglePlayerControllable to freeze the player.

Then get the coords and the angle:

Код:
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
Then calculate the position in front of him (replace distance with the distance obviously):

Код:
new Float:camx = distance * floatsin(-a, degrees), Float:camy = distance * floatcos(-a, degrees);
After that set the camera pos to the camx, camy (and z from player position) values and the camera to look at the original Player Position.

Spectate Mode is unneccessary plus it will make it impossible to see your own character.


If you want the character to be a bit more on the right or left of the screen, you can calculate a small offset for the x/y Player Position (similar to how the cam x/y was calculated) to make the camera look at the side of the character.

If you want the cam to be smoothly positioning itself just use CAMERA_MOVE in SetPlayerCameraLookAt.
Reply


Messages In This Thread
InterpolateCamera help - by SteeLFelna - 21.06.2017, 21:43
Re: InterpolateCamera help - by TEKNOJIHAD1 - 21.06.2017, 22:31
Re: InterpolateCamera help - by SteeLFelna - 21.06.2017, 22:39
Re: InterpolateCamera help - by TEKNOJIHAD1 - 21.06.2017, 22:53
Re: InterpolateCamera help - by SteeLFelna - 21.06.2017, 23:18
Re: InterpolateCamera help - by JasonRiggs - 22.06.2017, 00:55
Re: InterpolateCamera help - by SteeLFelna - 26.06.2017, 00:34
Re: InterpolateCamera help - by NaS - 26.06.2017, 14:32

Forum Jump:


Users browsing this thread: 3 Guest(s)