Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Angry Bots Photon project VR... Please help!

Discussion in 'AR/VR (XR) Discussion' started by Proto-G, Dec 30, 2014.

  1. Proto-G

    Proto-G

    Joined:
    Nov 22, 2014
    Posts:
    178
    I'm trying to port this over to VR and have got the camera somewhat working, but I have no idea how to switch the controls over so that the character is controlled only by a 360 controller and not the mouse/cursor. If you know how to do this, please share. Thanks!
     
  2. Falkrons

    Falkrons

    Joined:
    Dec 31, 2014
    Posts:
    8
    Wouldn't you be able to change the controls in the input manager? Edit>Project Settings> Input
     
  3. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Do you want to disable the mouse/keyboard input completely?
     
  4. Proto-G

    Proto-G

    Joined:
    Nov 22, 2014
    Posts:
    178
    Ok, so I got the controls working for the 360 by editing one of the scripts. I've also figured out how to disable the mouse/cursor thing and allow for the character to rotate with the right thumbstick. Now I just need to know the best way to bring in the OVR Camera. Right now I have it attached to the Main Camera with a Smooth Follow script. This is not working that well so if anyone has an idea that would work better, please do share :D Thanks!
     
  5. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,852
    You could just link it directly to the character and position it where you want it.

    Or you could write your own or look for alternate camera follow script.
     
  6. Proto-G

    Proto-G

    Joined:
    Nov 22, 2014
    Posts:
    178
    Problem is, I'm not sure how to do that with a networked game.
     
  7. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,852
    There should be some methods in Photon for when new players enter a game and another for when the 'game' is first created you need to either have:

    Two version of your characters one with the camera added one without for other players.
    Or logic that moves the VR camera above the player and sets the player as it's parent object.
    Or have every player with the VR camera disabled and only enable your players VR camera.

    I think the first approach should be easier as you just need to load the players character as the prefab with the camera. And any other players as the prefab without. Check out the viking example to see how it gets around this problem.
     
  8. Proto-G

    Proto-G

    Joined:
    Nov 22, 2014
    Posts:
    178
    K, thanks!
     
unityunity