Hello everyone !
I'm confronted to the famous multiplayer cameras problem (I saw a lot a questions about this, but couldn't solve mine...) for my FPS game.
I want to instantiate a player prefab for each client and the server. I need (locally) to attach the main camera to my player prefab, in a specific place of the model.
Here is the code attached to a gameobject NetworkManager, empty, in my scene :
I have a Network View attached to my player prefab. This is actually not working at all :). My camera stays still and does not follow my character, in debug mode I can clearly see that I go into the "if" loop. Does someone has an idea of the problem ?
The question has been closed Aug 29 '12 at 05:06 PM by KiraSensei for the following reason:
The question is answered, right answer was accepted
Attach a network view component to your camera, and then attach the following script to it as well.
You were asking more than just disabling the camera, take a look at this code:
There's a lot of stuff that needs to be adjusted in order for the game to separate the player from another player. The NetworkInterpolatedTransform script is what keeps the other player's movement shown on your computer.
answered Aug 28 '12 at 09:28 PM