#jittering
1 messages · Page 1 of 1 (latest)
does that fix the problem?
Why not try it
Are you using a rigidbody to move your player?
Yeah
Assuming the camera is a child of the rigidbody, youll need to userigidbody. moverotation instead of setting the transform.rotation value on the x axis. Making fps cameras work with rigidbodies is a bit of a pain especially if the camera is a child of the rigidbody
When you use a rigidbody you have to only stick to the rigidbody based functions when it comes to moving or rotating. If you use transform they override/fight each other which gives you the jitter
It would be easier to help if you show us how you have structured your player too
Alright wait
void Look()
{
transform.Rotate(Vector3.up * Input.GetAxisRaw("Mouse X") * mouseSensitivity);
verticalLookRotation += Input.GetAxisRaw("Mouse Y") * mouseSensitivity;
verticalLookRotation = Mathf.Clamp(verticalLookRotation, -90f, 90f);
cameraHolder.transform.localEulerAngles = Vector3.left * verticalLookRotation;
}
void FixedUpdate()
{
if (!PV.IsMine)
return;
rb.velocity += Physics.gravity * (gravityMultiplier - 1) * Time.fixedDeltaTime;
rb.MovePosition(rb.position + transform.TransformDirection(moveAmount) * Time.fixedDeltaTime);
}
void Move()
{
Vector3 moveDir = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical")).normalized;
moveAmount = Vector3.SmoothDamp(moveAmount, moveDir * (Input.GetKey(KeyCode.LeftShift) ? sprintSpeed : walkSpeed), ref smoothMoveVelocity, smoothTime);
}
there
Look and Move is in Update()
Have you tried using Input.GetAxis instead of Input.GetAxisRaw yet?
What should I try