Open danielbyomujuni opened 5 years ago
In case some new guys reading this, with SteamVR 2.0 things like SteamVR_ControllerManager, SteamVR_Controller.Device etc. do not exist anymore. You have to use "Actions" now.
Someone postet an update Version: https://paste.ubuntu.com/p/tWfF4CsKBN/ No compile errors but the swinging does not work 100% I guess, because for me, I even move if no button is pressed, but you get the idea of using actions like
SteamVR_Action_Pose, SteamVR_Action_Single, SteamVR_Action_Boolean, SteamVR_Action_Vector2
Btw: SteamVR_Action_Single is mapped as Vector1 in the SteamInput-Panel in Unity
Good luck!
If anyone comes across this message, I found the error that made the player move even when he is not moving his arms. On the updated version of the code shared above, around the line 400, there is a comment saying "//Save the current controller positions for our use" but the values updated are leftControllerPreviousLocalPosition and rightControllerPreviousLocalPosition , which are the previous positions. All you have to do is to replace leftControllerPreviousLocalPosition by leftControllerLocalPosition and rightControllerPreviousLocalPosition by rightControllerLocalPosition.
The problem came from the fact that since the current position was never updated, its value was always (0, 0, 0) so the difference between the current and the previous value was always huge, making the player move.
With that little correction, the script is working fine for me!
Is there also an updated version for the HeadsetCollider script?
In case some new guys reading this, with SteamVR 2.0 things like SteamVR_ControllerManager, SteamVR_Controller.Device etc. do not exist anymore. You have to use "Actions" now.
Someone postet an update Version: https://paste.ubuntu.com/p/tWfF4CsKBN/ No compile errors but the swinging does not work 100% I guess, because for me, I even move if no button is pressed, but you get the idea of using actions like
SteamVR_Action_Pose, SteamVR_Action_Single, SteamVR_Action_Boolean, SteamVR_Action_Vector2
Btw: SteamVR_Action_Single is mapped as Vector1 in the SteamInput-Panel in Unity
Good luck!
Hey, everyone I'm new to Unity and trying to work on my first VR project with the ArmSwinger. I've already imported SteamVR from the asset store and the updated ArmSwinger script from the link above.
But I'm keep getting the following error. (I haven't changed a single line of the script)
NullReferenceException: Object reference not set to an instance of an object ArmSwinger.setupHeadsetCollider () (at Assets/ArmSwinger/ArmSwinger.cs:1885) ArmSwinger.Awake () (at Assets/ArmSwinger/ArmSwinger.cs:345)
Does anyone know how to solve it?
I am no longer working on this project. What specific issues are you having?
If you decide to fix it yourself, please consider submitting a PR against the repository. I'll be happy to review it and merge it if it improves compatibility.