#Calling method from [ObserversRPC] is calling base class method instead of inheriting class

2 messages · Page 1 of 1 (latest)

wet glacier
#

I had this

 [SerializeField] SendingWorkStationUI myWorkstationUI;

    [ObserversRpc]
    void ObserverRefreshDisplay()
    {
        myWorkstationUI.RefreshDisplay();
    }

Where SendingWorkstationUI is inheriting from Monobehaviour WorkStationUI.
This was working, but just noticed that this had broken at some point, maybe in some Fishnet update(?).

The [ObserversRPC] was calling the base class virtual method, not the overridden method in the the inheriting class.

Moving the actual method call outside the [ObserversRPC] fixed it:

    [ObserversRpc]
    void ObserverRefreshDisplay()
    {
        LocalRefreshDisplay();
    }
    void LocalRefreshDisplay()
    {
        myWorkstationUI.RefreshDisplay();
    }

Using Fishnet 4.6.4

fast cove
#

Hi there, I just tested this and I cannot replicate the described issue