Network Instantiate error even when connected?

So I’ve been fighting with this simple script I’ve made which is supposed to fire a small projectile when the fire button is hit. Problem is, it doesn’t instantiate and instead throws an error:

“Failed Network.Instantiate because we are not connected.”

Thing is, I’m running a server and client side by side on my screen and they are connected. I can tell because both characters are plainly visible and respond to their individual inputs.

Here’s a snippet from my code, the part that I suspect may be the issue…

if(isLocalPlayer){
	if(Input.GetButtonDown(FireButton)){
		Network.Instantiate(Ammo, GunSpot.position,GunSpot.rotation,0);
				
	}
}

I’m new to the whole uNET, so any advice would be greatly appreciated.

“Network.Instantiate” belongs to the old networking system. Didn’t you get some obsolete warnings?

If you’re new to the new networking system i suggest start reading from here. The most important parts for your issue is most likely covered in Object Spawning and maybe Scene Objects. However i suggest to read though everything (maybe a couple of times).