Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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,980
    Looks like you are trying to spawn networked objects from the client. You can only call NetworkServer.Spawn on the server.