Strange RPC behaviour

I have a script that is supposed to run 4 RPC calls using RPCMode.All. All 4 of the functions are called correctly on the local player but only 3 are called on the same player on the rest of the network. I have no idea why it is behaving this way. Here is some code…

    protected virtual void Fire()
    {
               
        // update firing rate
        m_NextAllowedFireTime = Time.time + ProjectileFiringRate;

         //play fire sound
        if (SoundFireDelay == 0.0f) {
            networkView.RPC ("PlayFireSound", RPCMode.All); //PlayFireSound();
        } 

        // spawn projectiles
        if (ProjectileSpawnDelay == 0.0f){
            networkView.RPC ("SpawnProjectiles", RPCMode.All);//SpawnProjectiles();
        }

        // spawn shell casing
        if (ShellEjectDelay == 0.0f){
            networkView.RPC ("EjectShell", RPCMode.All);//EjectShell();
        }

        // show muzzle flash
        if (MuzzleFlashDelay == 0.0f){
            networkView.RPC ("ShowMuzzleFlash", RPCMode.All); //ShowMuzzleFlash();
        }

    }

    [RPC]
    protected virtual void PlayFireSound()
    {
        Debug.Log ("Play Sound");
    }

    [RPC]
    protected virtual void SpawnProjectiles()
    {
        Debug.Log ("Spawn Projectile");
    }

    [RPC]
    protected virtual void ShowMuzzleFlash()
    {
        Debug.Log ("Muzzle Flash");
    }

    [RPC]
    protected virtual void EjectShell()
    {
        Debug.Log ("Spawn Shell");
    }

The RPC that doesnt fire correctly on the rest of the network is EjectShell().

Thank you for any suggestions you have.

So right off the bat - comparing equality among floating point numbers is problematic. That being said - there is otherwise nothing immediately apparent in this code that would cause your issue so the problem is probably elsewhere.

I’d also be curious to see if that set up even worked with RPCs as I’d be very surprised if inheritance worked. Just guessing but - are you overriding EjectShell in a child class and not annotating it as an RPC? Does annotating it work? Does not overriding it work?

If you look at the network traffic in the Editor is it being sent/received correctly?

Thanks for your suggestion. I turned the network debug level to full and it says
Sent RPC call ‘PlayFireSound’ to all connected clients
Sent RPC call ‘SpawnProjectiles’ to all connected clients
Sent RPC call ‘ShowMuzzleFlash’ to all connected clients

but it does not mention EjectShell. I searched the whole project for EjectShell and this file is the only one with such a reference.

I still have no idea. Ill keep looking around in the project

Is that the case when the Editor is the player sending the RPC as well as the player receiving it?

It was the same both ways I believe.

I’ve created a work around anyways that should work better in the future. Thanks for your help though.