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.