- Home /
Using First Person Controller with networking causing problems
So when there's only one guy connected and using a FPS controller it works fine, but if another one connects, the control each others controllers / players. What's causing this and how can I fix it? I'm new to networking ,thanks in advance!
Answer by iwaldrop · Jan 12, 2014 at 07:37 PM
You need to limit the controls to the local instance of the FPC, then update the position and rotation over the network to connected peers.
In order to do so you should attach a NetworkView to the Player and query its isMine flag to determine if its locally or remotely instantiated. Only apply the player input to the local version.
Then Check out the Unity NetworkView Component, and MonoBehaviour's OnSerializeNetworkView. The latter has an example of how you can keep position and rotation synced across the network.
I figured it out thanks! Do you have any idea how to reduce the lagg? The players doesnt really move smooth its pretty chopped. Again thanks ;)!
You should post the code of how you're doing it in a new question.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
I need help with my Third Person Controller. Or Animations 0 Answers
UNET Network Transform Child 0 Answers
Trying to send command for object without authority - on a networkidenity with local authority 2 Answers
Serious Bug UnityWebRequest.SetRequestHeader is not working in non development mode on Android 1 Answer