Advertisement
Guest User

Untitled

a guest
Aug 17th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.84 KB | None | 0 0
  1. NullReferenceException: Object reference not set to an instance of an object
  2. BeardedManStudios.Network.NetworkingStream.PrepareFinal (BeardedManStudios.Network.NetWorker socket, IdentifierType identifierType, UInt64 behaviorNetworkId, BeardedManStudios.Network.BMSByte extra, NetworkReceivers receivers, Boolean bufferedRPC, System.String customidentifier, UInt64 senderId) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/NetworkingStream.cs:199)
  3. BeardedManStudios.Network.NetworkingStream.Prepare (BeardedManStudios.Network.NetWorker socket, IdentifierType identifierType, BeardedManStudios.Network.SimpleNetworkedMonoBehavior networkedBehavior, BeardedManStudios.Network.BMSByte extra, NetworkReceivers receivers, Boolean bufferedRPC, System.String customidentifier, UInt64 senderId) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/NetworkingStream.cs:182)
  4. BeardedManStudios.Network.SimpleNetworkedMonoBehavior.GetStreamRPC (System.String methodName, NetworkReceivers receivers, System.Object[] arguments) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/SimpleNetworkedMonoBehavior.cs:501)
  5. BeardedManStudios.Network.SimpleNetworkedMonoBehavior.RPC (System.String methodName, BeardedManStudios.Network.NetWorker socket, NetworkReceivers receivers, System.Object[] arguments) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/SimpleNetworkedMonoBehavior.cs:544)
  6. BeardedManStudios.Network.SimpleNetworkedMonoBehavior.RPC (System.String methodName, System.Object[] arguments) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/SimpleNetworkedMonoBehavior.cs:587)
  7. PistolBulletMP.OnCollisionEnter2D (UnityEngine.Collision2D collision) (at Assets/PistolBulletMP.cs:43)
  8.  
  9.  
  10.  
  11. void OnCollisionEnter2D(Collision2D collision) {
  12.         if (collision.gameObject.name != "bulletPistolMP" && collision.gameObject.name != "bulletPistolMP(Clone)" &&
  13.             collision.gameObject.name != "shotgunBulletMP" && collision.gameObject.name != "shotgunBulletMP(Clone)") {
  14.             RPC ("OnCollision", collision.gameObject.tag); // line 43
  15.         }
  16.  
  17.         if (!Networking.PrimarySocket.IsServer)
  18.             return;
  19.  
  20.         if (collision.gameObject.tag == "Destructible") {
  21.             DestructibleMP script = collision.gameObject.GetComponent<DestructibleMP> ();
  22.             script.TakeDamage (bulletDamage);
  23.         }
  24.  
  25.  
  26.     }
  27.  
  28.     [BRPC]
  29.     void OnCollision(string tag) {
  30.         Instantiate (explosion, new Vector3 (transform.position.x, transform.position.y, -1), Quaternion.identity);
  31.        
  32.         if (tag != "Enemy") {
  33.             for (int i = 0; i < (int)Random.Range(debrisMin, debrisMax); i++) {
  34.                 Instantiate (debris, new Vector3 (transform.position.x + Random.Range (-1.0f, 1.0f) * spread, transform.position.y + Random.Range (-1.0f, 1.0f) * spread, -1), Quaternion.AngleAxis (Random.Range (0.0f, 360.0f), Vector3.forward));
  35.             }
  36.         }
  37.        
  38.         Destroy (this.gameObject);
  39.         Destroy (instantiatedTrail);
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement