- Home /
Player Smoothness across network (PUN)
Hello everyone, I have been working on a project with multiplayer and the moment of the player is working however it is very glitchy and jitters a lot. Is there a way how I can make move moment smoother for other players?
In terms of networking I have been following this tutorial: https://www.youtube.com/watch?v=v9m48nhfgvI
but for my project I am using the 3D cylinder as my player.
I have 2 scripts, one is the Network Manager which is this:
using UnityEngine; using System.Collections;
public class NetworkManager : MonoBehaviour { const string VERSION = "v0.0.1"; public string roomName = "VVR"; public string playerPrefabName = "FPSController"; public Transform spawnPoint;
void Start() { PhotonNetwork.ConnectUsingSettings(VERSION); }
void OnJoinedLobby() { RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 4 }; PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
}
void OnJoinedRoom() { PhotonNetwork.Instantiate(playerPrefabName, spawnPoint.position, spawnPoint.rotation, 0); } }
And the other is the NetworkPlayer which is this:
using UnityEngine; using System.Collections;
public class NetworkPlayer : Photon.MonoBehaviour { public GameObject myCamera;
// Use this for initialization void Start () { if(photonView.isMine) { myCamera.SetActive(true); GetComponent().enabled = true; } else{ } } }
Any help on this issue would be much appreciated. Thank you.
Your answer
Follow this Question
Related Questions
Using Photon View To Sync "WheelCollider" how? 0 Answers
Unity networking tutorial? 6 Answers
Photon Player Controls Other Player 0 Answers
Light.color Sync ? 1 Answer
Animation over network using rpcs 0 Answers