Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Need help with Networking spawn error

Discussion in 'Connected Games' started by philipwlodarczyk42, Oct 11, 2018.

  1. philipwlodarczyk42

    philipwlodarczyk42

    Joined:
    Oct 1, 2018
    Posts:
    4
    I have created a script that works for the most part, the bullets are created, client can see them and be affected by them, but I have one problem, every time I shoot it spawns 2 bullets, 1 that goes forward like it is supposed to and one that just floats there. Every time I shoot I get this error

    SpawnObject for bullet(Clone) (UnityEngine.GameObject), NetworkServer is not active. Cannot spawn objects without an active server.
    UnityEngine.Networking.NetworkServer:Spawn(GameObject)
    PistolScript:Rpcshoot() (at Assets/PistolScript.cs:70)
    PistolScript:InvokeRpcRpcshoot(NetworkBehaviour, NetworkReader)
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()


    How can I fix this?
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    3,591
    Looks like you are trying to spawn networked objects from the client. You can only call NetworkServer.Spawn on the server.