Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actions with defaults assigned can change unexpectedly #1026

Open
ZnelArts opened this issue Apr 21, 2022 · 1 comment
Open

Actions with defaults assigned can change unexpectedly #1026

ZnelArts opened this issue Apr 21, 2022 · 1 comment

Comments

@ZnelArts
Copy link

ZnelArts commented Apr 21, 2022

Why the assigned SteamVR actions are being changed by themselves when I load a prefab that has some interactables?
See this video:

steamvrissue

Observe how the actions just change, the loaded prefab has no logic to change them, it just has a bunch of interactables.

[EDIT] Doing some more testing it doesn't require to drag the prefab to the scene, the actions change by just selecting the prefab in the Project Tab.

I have been on Unity 2020.3.27 for some time but this started to happen recently so is not related to the Unity version.
The only thing that changed recently is the SteamVR client which was updated to 1.21.12 recently.

Additionally every time this happens in the editor the file Open VR Settings.asset gets modified but I didnt change anything on it.

Another note is that this happens right after I get the error
NullReferenceException: Object reference not set to an instance of an object
Valve.VR.SteamVR_Action`2[SourceMap,SourceElement].get_Item (Valve.VR.SteamVR_Input_Sources inputSource) (at Assets/Imported/SteamVR/Input/SteamVR_Action.cs:44)
It seems sourceMap is null for some reason.

This issue seems very similar to #616

Im using the SteamVR Unity Plugin - v2.7.3 (sdk 1.14.15)

Thanks for any help.

@ZnelArts
Copy link
Author

ZnelArts commented Apr 21, 2022

Found what is causing the actions to change even when selecting the prefab on the editor.

As mentioned on the other issue, using defaults for actions will break SteamVR and trigger this bug.
I had code like this:

public class ZNEVRInteractor : MonoBehaviour {

    [SerializeField] private SteamVR_Action_Boolean _triggerInput = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("ACTION");
    [SerializeField] private SteamVR_Action_Single _triggerPressure = SteamVR_Input.GetAction<SteamVR_Action_Single>("TriggerPressure");
    [SerializeField] private SteamVR_Action_Boolean _gripInput = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("GrabGrip");

Changed it to:

public class ZNEVRInteractor : MonoBehaviour {

    [SerializeField] private SteamVR_Action_Boolean _triggerInput;
    [SerializeField] private SteamVR_Action_Single _triggerPressure;
    [SerializeField] private SteamVR_Action_Boolean _gripInput;

And that stops the issue from happening.

I hope Keith can take a look at this bug and find a solution for it.

@zite zite changed the title Assigned SteamVR Actions are changing unexpectedly Actions with defaults assigned can change unexpectedly Apr 21, 2022
@zite zite pinned this issue Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants