#so how to achieve that
1 messages · Page 1 of 1 (latest)
In your OnNetworkSpawn() check for IsLocalPlayer or IsOwner then disable the camera object
give me sec
ok where is OnNetworkSpawn() i can only see OnNetworkInstantiate();
what class is that from?
Are you using Netcode for Gameobjects?
that is super old. update to 1.5.2
sec
i did but i still cant see OnNetworkSpawn
what is OnNetworkSpawn()?
ok i had to use override thats why i couldn't see it didn't know
read through the docs here
https://docs-multiplayer.unity3d.com/netcode/current/basics/networkbehavior/#spawning
Both the NetworkObject and NetworkBehaviour components require the use of specialized structures to be serialized and used with RPCs and NetworkVariables:
public class CheckForCameras : NetworkBehaviour
{
public GameObject Camera;
public override void OnNetworkSpawn()
{
if (!IsOwner)
{
Camera.SetActive(false);
}
}
}
is that right way?
i am following tutorial of codemonkey but im just stuck at this point , i need to solve this to continue following it, thats why i just wanna get this over with so if u can help me i'd really appreciate it
ok well something worked right now but now i got another issue
imma solve it real quick
yeah its working now
I guess 2 cameras were breaking it , might be a wild guess tho