Multiplayer movement and camera....again.

Options
Sorry, i know this is a common issue and I have tried countless hours of videos and tutorials on the topics.

I am making a multiplayer game with PUN. Synchronized scenes.

I have a player (single player) and later a prefab (multiplayer) which has a movement script attached to it. I also have one camera in the scene "Main Camera". It has a script attached to it "CameraFollower". CameraFollower has a public variable"target".

In single player mode, the player's object exists in the editor and one can drag and drop this object onto the CameraFollower script to identify the object to be followed.

In multiplayer mode, this pplayer object does not exist. It gets created via Photon.instantiate. How do I set the target of my CameraFollower script (attached to the Main camera) to this instantiated player and only for the local player?

How do I modify my movement script such that it only works for the local player?

Thanks in advance.

Comments