Moving Camera
#1

Код:
SetTimerEx("MovingCamera", 10, true, "%i", playerid);
i set camera to move every 10 milliseconds

Код:
public MovingCamera(playerid)
{
	new Float:X, Float:Y, Float:Z = GetPlayerCameraPos(playerid, X, Y, Z);
	SetPlayerCameraPos(playerid, X+2, Y+2, Z);
	SetPlayerCameraLookAt(playerid, X+2, Y+2, Z);
	return 1;
}
the function for moving

the problem is that it moves the camera like in 1 sec not in 10 milliseconds!
Reply
#2

Joining this question, I used to have a problem with this too.
Reply
#3

This probably is a server/samp problem. The timerinterval is not 1/1000 sec accurate, also on fast systems, it is +-100-200ms. Creating new variables and getting and setting all the camerastuff also eats some processtime, which create additional delays, so an 10ms update timer is just not possible.

You could try to add it to OnPlayerUpdate, it is called as fast as possible then, but may cause lags.
Reply
#4

I also made a moving camera script and it moves very smooth at 20 ms.
I also used PVars.
Reply
#5

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
I also made a moving camera script and it moves very smooth at 20 ms.
I also used PVars.
can you tell me how?

Putting under onplayerupdate is the same!
Reply
#6

Still anyone?
Reply
#7

**bump** anyone?
Reply
#8

Possibly it might be because you're setting the camera look at thingy to the same pos at the camera's, even though it sounds unlikely.

What about a camera of 33ms? Still 30 movements a second which is equal to 33 FPS (Almost)
Reply
#9

Still the same, anyone?
EDIT: It moves faster if i hold mouse buttons
Reply
#10

You could apply some looping animation to the player (/box), and set moving the camera on their OnPlayerUpdate. Player updates much more often when in a looping animation. If it's too fast, make a counter and set it, for example, each 2 updates.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)