Lerping position?
Hi,
I've seen some examples of how to lerp from a start position to an end position which is supposed to make the movement appear smoother in a multiplayer game, however it seems it's all for automated or AI movement and not for players moving the players themselves. Here's the movement part of my characters controller script:
I rotate the camera/character with the mouse:
rotationX += Input.GetAxis("Mouse X") * lookSpeed;
rotationY += Input.GetAxis("Mouse Y") * lookSpeed;
transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up);
transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left);
And then I've got gradual acceleration in the direction the camera is facing with AddForce:
if (Input.GetKey(KeyCode.W))
{
player.AddForce(transform.forward * speed2 * 98 * Time.deltaTime);
}
How am I supposed to "Lerp" position to achieve the completely smooth movement/position Update seen by all players during gameplay so as to lower the message sendrate which is now 60/30 and still not perfectly smooth?
I've seen some examples of how to lerp from a start position to an end position which is supposed to make the movement appear smoother in a multiplayer game, however it seems it's all for automated or AI movement and not for players moving the players themselves. Here's the movement part of my characters controller script:
I rotate the camera/character with the mouse:
rotationX += Input.GetAxis("Mouse X") * lookSpeed;
rotationY += Input.GetAxis("Mouse Y") * lookSpeed;
transform.localRotation = Quaternion.AngleAxis(rotationX, Vector3.up);
transform.localRotation *= Quaternion.AngleAxis(rotationY, Vector3.left);
And then I've got gradual acceleration in the direction the camera is facing with AddForce:
if (Input.GetKey(KeyCode.W))
{
player.AddForce(transform.forward * speed2 * 98 * Time.deltaTime);
}
How am I supposed to "Lerp" position to achieve the completely smooth movement/position Update seen by all players during gameplay so as to lower the message sendrate which is now 60/30 and still not perfectly smooth?
0
Comments
-
Anybody?0
-
This forum isn't active at all2