Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by brandonhotdo · Aug 22, 2014 at 03:54 AM · networkingnetworkrpcnetworkview

Networking Error!

So this is the error! View ID AllocatedID: X not found during lookup. Strange behaviour may occur. (A second error that always come's after the first one) Received state update for view id' AllocatedID: X' (this is the same value as the first X) but the NetworkView doesn't exist. And I get multiple of those errors together but with a different X value! These Error's only appear when the first player joins the game (that's not including the host). However if X is equal to 14 I check the Hierarchy and there is a object with the view id of 14! Now just so things make sense to you so you know what to tell me is: I have that spawn's at least 60 star's with network view's attached to them, they also have a gameobject attached to them called SolarSystem that does not have a network view(The SolarSystem is just a large sphere collider with on trigger on)! When ever the SolarSystem from two different Stars collide it rolls a dice on witch star will get deleted (so that stars don't spawn in side each other). This is the code that does that(This script is attached to the SolarSystem):

 #pragma strict
 var Dice = 0;
 Dice = Random.Range(1,100);
 private var anotherScript : SunDele;
 function OnTriggerEnter(slr : Collider){
  anotherScript = slr.GetComponent(SunDele);
 if (anotherScript == null){
 Debug.Log("Lol");
 }else{ 
 if (anotherScript.Dice > Dice && gameObject.transform.parent.gameObject != null){
 Destroy (gameObject.transform.parent.gameObject);
 }
 }
 } 

Now I tried turning it to Network.Destory but I still got errors. This is the code that spawn's the stars:

 using UnityEngine;
     using System.Collections;
 
 public class StarCreate : MonoBehaviour {
     public GameObject Star;
     public int Amount = 900;
     int x;
     int y;
     int z;
     GameObject[] StarCount;
 void Start () {
 int i = 0;
 while (i < Amount) {
             x = Random.Range (-79616, 79616);
             y = Random.Range (-79616, 79616);
             z = Random.Range (-79616, 79616);
             networkView.RPC("SpawnStar",RPCMode.All,x,y,z);
 i++;
 }
 }
 [RPC] void SpawnStar(int Xd, int Yd, int Zd){
         GameObject Stars = (GameObject)Network.Instantiate(Star, new Vector3 (Xd, Yd, Random.Range (-79616, 79616)), Quaternion.identity,0);
     }
 }

I have also noticed that when the player joins (not the host) its creates another set of stars! So that made me think it might also have something to do with the network manager code so here its is: using UnityEngine; using System.Collections;

 public class NetworkManager2 : MonoBehaviour {
     public static NetworkManager2 Instance;
     public GameObject Player;
     public GameObject BackGround;
     private GameObject MainMenu;
     public GameObject CentreOfUni;
 
 
     
     // Use this for initialization
     void Start () {
         MainMenu = GameObject.Find ("MainMenu");
         BackGround = GameObject.Find ("Background");
         Instance = this;
         DontDestroyOnLoad (gameObject);
     }
     public void StartServer(int MaxPlayers, int Port, string ServerName, string IpAddress){
         Network.InitializeSecurity ();
         bool useNat = !Network.HavePublicAddress();
         Network.InitializeServer (MaxPlayers, Port, useNat);
         Debug.Log ("Starting server on " + IpAddress + ":" + Port);
     }
     void OnConnectedToServer() {
         Network.minimumAllocatableViewIDs = 1000;
         Debug.Log("Connected to server");
         MainMenu.SetActive(false);
         BackGround.SetActive (false);
         SpawnPlayer ();
 
 
     }
     void OnFailedToConnect(){
         MainMenu.SetActive (true);
         Debug.Log ("Failed to connect!");
     }
     void OnServerInitialized(){
         Network.minimumAllocatableViewIDs = 1000;
         Debug.Log ("Server Created");
         GameObject Universe = (GameObject)Network.Instantiate (CentreOfUni, new Vector3 (0, 0, 0), Quaternion.identity, 0);
         MainMenu.SetActive(false);
         BackGround.SetActive (false);
         SpawnPlayer ();
         }
     void SpawnPlayer(){
         GameObject ClientPlayer = (GameObject)Network.Instantiate (Player, new Vector3 (0,0,0), Quaternion.identity, 0);
         ((MonoBehaviour)ClientPlayer.GetComponent ("PlayerQue")).enabled = true;
     }
     public void ConnectToServer(string Ipaddress, int Portl) {
         Network.Connect(Ipaddress, Portl);
     }
 
 
 }

Now its CentreOfUni That has the script that spawns all the stars! And that is about it so yeah that would be nice if you could tell me what I have done wrong :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

View ID AllocatedID: # not found during lookup. Strange behaviour may occur 1 Answer

RPC or Synchronization ? 1 Answer

Multiplayer Moving Bullet 1 Answer

RPC vs WWW : Performance 1 Answer

How can I get "!networkView.isMine" to function properly? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges