Camera control problem

Hi guys

I have made a basic networking racing game. At the moment I have one camera that is overviewing the whole racing track so that all the players can see each other. My question is this:

Ho can I create a camera for each player that would LookAt that player’s transform position. I understand the LookAt method, I just don’t know how I will implement it over a network.

In a networked environment, each networked player will have every other player’s car as an object.

So, the “server”, should have all cars create as game object.

Therefore, you just need to use the LookAt at the object you want.

Thanks nvarcha

I kinda understand what you mean. Should I then place a camera inside my car prefab or should I just have one, main camera in my Hierarchy?

Tiaan

Make a camera manager script (or a initialisation script, to be more general), and a prefab camera. when the scene start, call Network.Instantiate.

The camera prefab instantiated must have a NetworkView, the observed component is its Transform component, and the state synchronization should be Unreliable.

@AkilaeTribe

“…The camera prefab instantiated must have a NetworkView, the observed component is its Transform component, and the state synchronization should be Unreliable…”

I understand, just one thing…the NetworkView for the camera must it observe the camera’s Transform or my Car prefab transform?

The camera’s own Transform, no ? Isn’t it that gameObject you want to be synchronized ?