#jittering

1 messages · Page 1 of 1 (latest)

limpid palm
#

Hmm. Why are you using GetAxisRaw
Mouse value is continous, not discrete

edgy aspen
#

does that fix the problem?

limpid palm
#

Why not try it

main mica
#

Are you using a rigidbody to move your player?

main mica
#

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

edgy aspen
#

Alright wait

edgy aspen
# main mica When you use a rigidbody you have to only stick to the rigidbody based functions...

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()

limpid palm
#

Have you tried using Input.GetAxis instead of Input.GetAxisRaw yet?

main mica
#

That wont fix jitter

#

GetAxisRaw is fine to use in a camera controller

edgy aspen
#

What should I try