I have four scenes.
One Mainscene - Canvas with buttons like cube,sphere,capsule
NetworkManager with my script attached
Player prefab - Canvas prefab with buttons like cube,sphere,capsule
Other three scenes - Cubescene,Sphereschene,Capsulescene containing animation.
I have network manager in mainscene and when i clicked buttons in mainscene i can navigate to cubescene and other scenes using ServerChangeScene method. It is working fine. but after switched to new scene, canvas prefab from mainscene is appearing in newly loaded scene.This is because i clicked Don’t destroy onload. I tried to disable and hide this canvas. nothing is happening.
Please help me to disable or hide this canvas CLONE after switching to new scene. I have back button in all the other three scenes. if i click back button in other scene, i want to enable the canvas clone.
So I understand correctly; The scene you are switching to has a canvas element that you want all the clients to disable once the scene has loaded?
If so, what code are you currently using to do this?
I assign this canvas clone by dragging in to inspector to a public variable in one script.This script is attached to network manager.Dragged the network manager to prefab folder. Then called a function in this script by selecting networkmanager to button onclick (back button) for all the scenes.
Script:
public gameobject canvasclone;
[Command]
public void CmdHideCanvas()
{
RpcClientHideCanvas();
}
[ClientRpc]
public void RpcClientHideCanvas()
{
canvasclone.SetActive(false);
}
Please help me