- Home /
ClientRpc inheritance issue
Hello everyone,
I am converting my game's network system to the new UNET framework and got into some issues. The game classes are designed so that all objects have an Entity behaviour (inherits from NetworkBehaviour) which contains Factory methods and all common initialisation functions and so on. Most objects in the scene will however derive the Entity class (Building, Tank, Aircraft, ...), override some functions and implement new, object specific ones. The networked event systems (my implementation) are in the Entity script and include some [ClientRpc], [Server], [Client], ... methods that derived classes do not need to override. The ClientRpc are not called on the objects with a derived script. Is this a feature or a bug? Or am I doing something wrong? If I rewrite those functions on the derived classes, then it all works, but this is quite a dumb solution as each one will have to reimplement all those functions. Any other workaround?
Thanks for helping. Cheers.
3 years later I have this exact same problem: https://forum.unity.com/threads/odd-behaviour-changes-class-type-on-clientrpc.533916/
For me it finds the first best derived class and run that method ins$$anonymous$$d. If I remove it, then it tries another until it's only one derived class left.
Your answer
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
Java-Multiple inheritance in Networking 0 Answers
Unity networking tutorial? 6 Answers
RPC and inheritance 1 Answer
C# inheritance advice 2 Answers