#what is mouse delta....

1 messages · Page 1 of 1 (latest)

pure tangle
#

thats true but basically I am:
-recording mouse delta
-Changing transform rotation by that
and since it's recording delta in chunks of around like 4 or 7 depending on how fast I move the mouse, it's moving by a few degrees per frame which seems jittery and inconsistent

rare furnace
#

show the code

pure tangle
#
//Camera
 private float3 lookRot = new float3();

    private void OnLook(InputValue lookValue)
    {
        float2 lookData = lookValue.Get<Vector2>();
        lookRot.xy = lookData; 

        if (invertYAxis)
        {
            lookRot.y *= -1; //invert view axis
        }
        lookRot.xy = lookRot.yx; //swap axes
    }

private void FixedUpdate()
    {
        transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles + new Vector3(lookRot.x, 0f, 0f));
    }

public float3 get_look_rot()
    {
        return lookRot;
    }

//Player capsule
private void FixedUpdate(){
  rb.rotation = Quaternion.Euler(transform.rotation.eulerAngles + (Vector3)GetComponentInChildren<PlayerCameraRotation>().get_look_rot().zyz);
}

rare furnace
#

You have two FixedUpdates

pure tangle
#

look at the comments

rare furnace
#

But basically it's because you're doing the rotation in FixedUpdate

pure tangle
#

those are two different scripts

rare furnace
#

input happens in sync with Update (once per frame)

#

FixedUpdate doesn't run every frame

#

so you're missing some input

#

that happens between the FixedUpdates

pure tangle
#

oh okay let me try that

rare furnace
#

But really you can just go ahead and do the rotation directly in OnLook