ElectricNightOwl / ArmSwinger

ArmSwinger is an artificial VR locomotion library developed on Unity 5.4. ArmSwinger allows you to use your arms to control your position in 3D space in a natural way with minimal disorientation.
http://electricnightowl.com/armswinger/
MIT License
101 stars 30 forks source link

The Code Needs Updated to fit the new steamVR Plugin 2.0.1 #54

Open danielbyomujuni opened 5 years ago

kjack9 commented 5 years ago

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.

TedDawkin commented 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!

Etidri commented 4 years ago

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!

Lualttt commented 2 years ago

Is there also an updated version for the HeadsetCollider script?

AONYA-LU commented 1 year 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!

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?