Spawning Player in Multiplayer Environment

Player controls are working, tried to create the first person view by setting up the camera as child game object it didn’t work, and even after deleteing the camera from the scene there is still a camera so where is that camera coming from and can can we modify it

by user 406778568597831690

There definitely shouldn’t be any extra camera.

You can search for any cameras in your scene like this: t:camera
image.png

When you delete all cameras and no glb contains a camera a default camera will be created at runtime.

ok but when i am creating a camera as child of a prefab its not coming is there any way to use that camera, and how to debug this ?

by user 406778568597831690

By It's not coming you mean it’s not being used / visible?
You can add a query parameter debugcam to your url to get a log for all cameras in the scene

Is the prefab active in the hierarchy? When is the camera/prefab being loaded? If you want the camera to be enabled automatically when it becomes active set the tag to MainCamera in Unity

my camera was not tagged as main camera, but when there is more than one player in multiplayer, then if local rotating player rotates camera, it rotates camera for other players not for local player. do i need to request ownership in Camera Componet too?

by user 406778568597831690

What if you get the camera for the local player and call this.context.setCurrentCamera(yourcamcomponent) ?

Without setting it to MainCamera

i will try this

by user 406778568597831690

this worked but now there is wird issue that if teh Player id idle for a long time and then start’s interacting with it again, the system creates a new instance of local player and that way there are two players in the scene for one user. how to fix this

by user 406778568597831690

i am in First person mode and I cam see other person as well

by user 406778568597831690

which is another instacne of me

by user 406778568597831690

Could you show the log?

Also try doing that with debugplayersync

by user 406778568597831690

And when in the log did the second instance appear?

I noticed similar behavior when i hot reloaded. Please make sure that is happening on a production build as well (like if you deploy to glitch)

its happening on production as well

by user 406778568597831690

Ok :confused: