wesleywh / EasyMultiplayer-Invector

Where to submit issues for "Easy Multiplayer - Invector" suite of packages that is available via GumRoad or the Unity Asset Store. GUMROAD: https://cyberbulletgames.gumroad.com/ ASSET STORE: https://assetstore.unity.com/publishers/34070
0 stars 0 forks source link

When player dies from fall damage this happens #7

Closed AmmarTee closed 2 years ago

AmmarTee commented 2 years ago

NullReferenceException: Object reference not set to an instance of an object at EMI.UI.KillCounterPlayer.OnDamaged (Invector.vDamage damage) [0x00036] in <6a8f45902a504c83881fd5692e8db136>:0 at UnityEngine.Events.InvokableCall1[T1].Invoke (T1 args0) [0x00010] in <ad199b1c67244da3a5ed230e5d202f21>:0 at UnityEngine.Events.UnityEvent1[T0].Invoke (T0 arg0) [0x00025] in :0 at Invector.vHealthController.TakeDamage (Invector.vDamage damage) [0x00067] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vCharacter.TakeDamage (Invector.vDamage damage) [0x00000] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vThirdPersonMotor.TakeDamage (Invector.vDamage damage) [0x00049] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.MP_vThirdPersonController.TakeDamage (Invector.vDamage damage) [0x0005a] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vThirdPersonMotor.CheckFallDamage () [0x00074] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vThirdPersonMotor.CheckGround () [0x00069] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vThirdPersonMotor.UpdateMotor () [0x0000c] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vThirdPersonInput.FixedUpdate () [0x00018] in <6a8f45902a504c83881fd5692e8db136>:0 at Invector.vCharacterController.vMeleeCombatInput.FixedUpdate () [0x00000] in `<6a8f45902a504c83881fd5692e8db136>:0

To recreate this bug: 1 - Join the server 2 - Fall from high place 3 - Bug

wesleywh commented 2 years ago

Cannot replicate.

  1. Tested In unity with Server+Client - No error
  2. Tested in dedicated server build + unity client - no error
  3. Tested in dedicated server build + client build - no error
  4. Tested in dedicated server build + client build + unity client - no error
  5. Tested in unity server + client build - no error

Please include all the requested information when making this ticket. My guess is you're using an untested version of Mirror (A shot in the dark).

Will re-open if can find something definitive to fix.

AmmarTee commented 2 years ago

Try to do the same thing with two instances of windows build on same server and see what happens?

wesleywh commented 2 years ago

Sure I can try that.

AmmarTee commented 2 years ago

I am using this modification in the Mp_vHitDamageParticles.CS and it is causing me the issue

using EMI.Object; using EMI.Utils; using UnityEngine; using Mirror;

namespace Invector { public class MP_vHitDamageParticle : vHitDamageParticle { [SerializeField, Tooltip("If you want to display self damage or not.")] protected bool displaySelfDamage = false; protected Team team = null; protected virtual void Awake() { team = (Team)gameObject.FindComponent(typeof(Team)); }

    public override void OnReceiveDamage(vDamage damage)
    {
        // check teams don't show damage on friendly (if team component available)
        if (team == null || damage.sender == null || !damage.sender.transform.root.GetComponent<Team>() || (
            damage.sender.transform.root.GetComponent<Team>() &&
          damage.sender.transform.root.GetComponent<Team>().IsEnemy(team.teamName)))
        {

            // prevent self damage (if enabled)
            if (!displaySelfDamage && damage.sender != null && damage.sender.transform.root.gameObject.Equals(transform.root.gameObject))
                return;

          if(damage.sender.transform.root.GetComponent<NetworkIdentity>().hasAuthority){
              Debug.Log("Damaged");
          }
            // past all checks (EX: Is enemy team and not damaging myself)
            base.OnReceiveDamage(damage);
        }
    }
}

}