Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Networking Player Prefab camera for Oculus

Discussion in 'Multiplayer' started by MarxentAnthony, Jul 10, 2015.

  1. MarxentAnthony

    MarxentAnthony

    Joined:
    Feb 20, 2015
    Posts:
    18
    What would be the best way to network the camera' transform on a client using Oculus? Right now my Prefab's transform is networked but not the Camera's transform.
     
  2. peterept2

    peterept2

    Joined:
    Aug 1, 2012
    Posts:
    41
    I just did this. Because the player can only send its top level network transform you can add a sync bar for the cameras local rotation 'head'. And send that to the server via a Command like CmdUpdateHead Whch just sets the sync var so it sends to all client.

    To avoid jerky I smooth it with a lerp unless it has been a long time since the last sync.

    I can post some code later tonight when I get home.
     
  3. MarxentAnthony

    MarxentAnthony

    Joined:
    Feb 20, 2015
    Posts:
    18


    Thank you for this and the other posts, I would be grateful for any example code you can provide.

    Anthony