Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NullReferenceException: Object reference not set to an instance of an object
- 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)
- 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)
- BeardedManStudios.Network.SimpleNetworkedMonoBehavior.GetStreamRPC (System.String methodName, NetworkReceivers receivers, System.Object[] arguments) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/SimpleNetworkedMonoBehavior.cs:501)
- 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)
- BeardedManStudios.Network.SimpleNetworkedMonoBehavior.RPC (System.String methodName, System.Object[] arguments) (at Assets/Bearded Man Studios Inc/Forge Networking/MainScripts/SimpleNetworkedMonoBehavior.cs:587)
- PistolBulletMP.OnCollisionEnter2D (UnityEngine.Collision2D collision) (at Assets/PistolBulletMP.cs:43)
- void OnCollisionEnter2D(Collision2D collision) {
- if (collision.gameObject.name != "bulletPistolMP" && collision.gameObject.name != "bulletPistolMP(Clone)" &&
- collision.gameObject.name != "shotgunBulletMP" && collision.gameObject.name != "shotgunBulletMP(Clone)") {
- RPC ("OnCollision", collision.gameObject.tag); // line 43
- }
- if (!Networking.PrimarySocket.IsServer)
- return;
- if (collision.gameObject.tag == "Destructible") {
- DestructibleMP script = collision.gameObject.GetComponent<DestructibleMP> ();
- script.TakeDamage (bulletDamage);
- }
- }
- [BRPC]
- void OnCollision(string tag) {
- Instantiate (explosion, new Vector3 (transform.position.x, transform.position.y, -1), Quaternion.identity);
- if (tag != "Enemy") {
- for (int i = 0; i < (int)Random.Range(debrisMin, debrisMax); i++) {
- 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));
- }
- }
- Destroy (this.gameObject);
- Destroy (instantiatedTrail);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement