Moving cameras.
#1

Hey there.

I'm making a dynamic intro-screen to my server.

I need my SetPlayerCamera and SetPlayerCameraLookAt to move, somehow.

Any ideas?
Reply
#2

Timer.
Reply
#3

Yeah, of course I can change the position instantly, but I want it smoothly.

Like, the camera turning around in a circle or sliding etc.
Reply
#4

http://forum.sa-mp.com/index.php?topic=115765.0
Reply
#5

How smooth it moves depends on the timer interval. The faster you change position the smoother it is.
Reply
#6

pawn Код:
forward startscreen(playerid);
public startscreen(playerid)
{
  SetPlayerCameraPos(playerid, 956.0391,2585.1912,10.6282);
    SetPlayerCameraLookAt(playerid, 977.8350,2575.9636,21.6403);
    SetTimerEx("visagecam", 10000, false, "%d", playerid);
}

forward visagecam(playerid);
public visagecam(playerid)
{
    cam_x = 2128.9561;
    cam_y = 1858.9218;
    cam_z = 10.6719;
    SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
    SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
    SetTimerEx("visagecammove", 100, true, "%d", playerid);
}

forward visagecammove(playerid);
public visagecammove(playerid)
{
    cam_y = cam_y + 1.2;
    cam_z = cam_z + 1.0;
    SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
    SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
}
So why doesn't this work?

Startscreen is called on a 1,1second interval on connect, and it works fine. However, the camera outside the Visage hotel does not move.
Reply
#7

Is startscreen called only once or many times?
Reply
#8

pawn Код:
SetTimerEx("startscreen", 1100, false, "%d", playerid);
At the end of OnPlayerConnect.

That works fine though, and the camera is set to the correct position after the camera has been at the "startscreen"s position for 10 seconds, however it does not move.

I set it to move slightly every 0,1 second, however it doesn't move at all...

Strange stuff.
Reply
#9

Код:
forward startscreen(playerid);
public startscreen(playerid)
{
  SetPlayerCameraPos(playerid, 956.0391,2585.1912,10.6282);
	SetPlayerCameraLookAt(playerid, 977.8350,2575.9636,21.6403);
	SetTimerEx("visagecam", 10000, false, "%d", playerid);
}

forward visagecam(playerid);
public visagecam(playerid)
{
	cam_x = 2128.9561;
	cam_y = 1858.9218;
	cam_z = 10.6719;
	SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
	SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
	SetTimerEx("visagecammove", 100, true, "%d", playerid);
}

forward visagecammove(playerid);
public visagecammove(playerid)
{
	cam_y = cam_y += 1.2;
	cam_z = cam_z += 1.0;
	SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
	SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
}
Try that
Reply
#10

What did you change?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)