playMaker

Author Topic: Playmaker Photon with Oculus Rift  (Read 2023 times)

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
    • View Profile
Playmaker Photon with Oculus Rift
« on: March 25, 2014, 03:31:55 AM »
Hi there,

I was wondering if anyone else has tried integrating playmaker/photon into a scene using oculus rift?

I can load a scene and instantiate a player fine but as soon as a second user logs in the fun starts. Players cant see each other, the cameras are locked in position and detached from the character.

On the demo scene everything is in one game object so I guess one photon view is enough. With oculus though there is a set hierarchy so I'm wondering if I need more Photon views.
The hierarchy is basically this:

OVRPlayerController (has the character controller and my gamepad controller)
> ForwardDirection(this gameobject needs to contain the character model)
>>CharacterModel (with animation done using Animator)
> OVRMainCameraController (holds the L/R cameras with a script to control FOV etc)
>>CameraLeft
>>CameraRight

Any help would be appreciated.

Thanks,
Matt

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Playmaker Photon with Oculus Rift
« Reply #1 on: March 25, 2014, 04:47:11 AM »
Hi,

 Yep, I worked on photon/oculus integration, I'll ask the owner of the project if I can share this.

 basically, completly abstract the implementation with a proxy, this is the best way.

1: other player must see you, even tho you don't have a character in your own instance, since you use OVR. So you need to work on a system that when is mine has no "character" and when not is mine has a character.
2: don't touch the OVR setup, simply get it's position and rotation and feed that to control the "character" model on the other side of the network.

 Does that make sense?

Bye,

 Jean

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
    • View Profile
Re: Playmaker Photon with Oculus Rift
« Reply #2 on: March 25, 2014, 05:13:43 AM »
Yeah that makes a lot more sense, It's definitely struggling with the cameras.
It would also solve the problem of being able to see each others GUIs too.

If you could get permission to share the project that would be awesome, thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Playmaker Photon with Oculus Rift
« Reply #3 on: March 26, 2014, 11:56:49 PM »
Hi,

 Good news, it's ok for distribution :) Please download it here:

https://dl.dropboxusercontent.com/u/17356625/Unity/shared/PhotonOVR.unitypackage

Warning: This is not a PlayMaker solution, it's purely script based, the main script being "OVRPlayerNetwork", which essentially act as a proxy between the photon player and the OVR. You can do this in playmaker fully, but that was not necessary at the time of development.

Typically, you will also need to implement your own character, this example is using the well know "worker" character.

Don't hesitate to ask questions, it's been a while, but it should still work properly.

Many Thanks to Chris Collins from Tipodean for letting me sharing this work with you guys.

http://www.tipodean.com/

Btw, Chris is also behind the great Strangeling app:

http://strangelings.com/index.htm

Which features a lot of work done in PlayMaker as well. :)

 Bye,

 Jean

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
    • View Profile
Re: Playmaker Photon with Oculus Rift
« Reply #4 on: March 27, 2014, 09:22:08 AM »
That's brilliant, thank you Jean and Chris!