Search Unity

WASD movement problem in Editor but only in Android mode

Discussion in 'Editor & General Support' started by stain2319, Mar 12, 2020.

  1. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    417
    I am wondering if anyone out there has any ideas on this - I have reached out to the developers of the SDK I am using but this seems more like a weird Unity problem so I thought I would also post it here.

    It would be easiest to describe the problem by giving the steps to reproduce it - maybe someone out there can try and reproduce this and let me know if it does the same thing for them?

    - create a new Unity project in your preferred version and make sure you are in PC/Linux/Mac Standalone mode
    - to this project, obtain the free "VZFit SDK" asset and import it
    - within the VZ folder open the sample scene
    - press Play on the editor
    - you will now be able to control your avatar with keyboard arrows and WASD.
    - the important part here is the behavior of W+S which will cause your avatar to lean forward/back
    - you will know you are leaning forward/back because the HUD in front of you will move in response

    Now, the odd part - if I switch platforms to Android, I can no longer use W+S to lean forward/back. A+D still lean left/right but W+S don't do anything.

    In PC mode I can see looking at the 'Head' object that it is moving Z position when I press W/S, but as soon as I switch to Android it doesn't move the Head at all.

    Is this just me? Can anyone else reproduce this and/or have any idea why this would be?

    It is sort of annoying to switch platforms just to test in the editor...
     
  2. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    417
    OK, I think I found it.

    Code (csharp):
    1.  
    2. #if (UNITY_ANDROID && !VZ_SNAPDRAGONVR) || UNITY_IOS
    3. # if VZ_GOOGLEVR
    4.       TiltSteering = !GvrHeadset.SupportsPositionalTracking;
    5. # elif VZ_GEARVR
    6.       TiltSteering = (OVRPlugin.GetSystemHeadsetType() != OVRPlugin.SystemHeadset.Oculus_Quest);
    7. # else
    8.       TiltSteering = true;
    9. # endif
    10. #else
    11.       TiltSteering = false;
    12. #endif
    13.  
    I am developing for Oculus Quest but it looks like since I am not playing with the Quest it sets this to True.