Meorge / JoyConUnityInputSystem

8 stars 4 forks source link

Left joycon is laggy #4

Open raytsang opened 3 months ago

raytsang commented 3 months ago

https://github.com/Meorge/JoyConUnityInputSystem/assets/1432620/09363df5-73ee-4cad-b4db-0624c5c70774

It is the Test3.scene and modify the GyroRotate.cs to the following to separate left and right joycon:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem.Switch;

public class GyroRotateL : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (SwitchJoyConLHID.current.buttonSouth.wasPressedThisFrame)
        {
            // SwitchControllerHID.current.ReadIMUCalibrationData();
            SwitchJoyConLHID.current.SetIMUEnabled(true);
        }
        transform.eulerAngles = SwitchJoyConLHID.current.orientation.ReadValue() * 0.1f;
    }
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem.Switch;

public class GyroRotateR : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (SwitchJoyConRHID.current.buttonSouth.wasPressedThisFrame)
        {
            // SwitchControllerHID.current.ReadIMUCalibrationData();
            SwitchJoyConRHID.current.SetIMUEnabled(true);
        }
        transform.eulerAngles = SwitchJoyConRHID.current.orientation.ReadValue() * 0.1f;
    }
}
Meorge commented 3 months ago

Thanks for submitting this! I remember the gyro support was one of the later things I did on the project, and it was experiencing more issues than some of the other, simpler inputs.

Unfortunately at the moment I'm not working a lot with Unity or this package, but sometime soon I may be able to take a look at it. It may be worth taking a look at this fork which is being more actively maintained.

raytsang commented 3 months ago

That would be great, thank you!

在 2024年4月30日週二 23:12,Malcolm Anderson @.***> 寫道:

Thanks for submitting this! I remember the gyro support was one of the later things I did on the project, and it was experiencing more issues than some of the other, simpler inputs.

Unfortunately at the moment I'm not working a lot with Unity or this package, but sometime soon I may be able to take a look at it. It may be worth taking a look at this fork https://github.com/thomasduhamel/Switch-Controller-for-Unity which is being more actively maintained.

— Reply to this email directly, view it on GitHub https://github.com/Meorge/JoyConUnityInputSystem/issues/4#issuecomment-2085607120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK5YLH7FYEXHMZO4UDYAGTY76YGRAVCNFSM6AAAAABG72VWPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVGYYDOMJSGA . You are receiving this because you authored the thread.Message ID: @.***>

rileywrites commented 3 days ago

i have the same issue, but not just with gyro!! one joycon has much higher input latency than the other, with *all* inputs fairly delayed compared to the second.

for me, the right Joy-Con is much laggier than the left Joy-Con. it's inconsistent, though—sometimes the latency goes away entirely after re-connecting.