Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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