Server and Client implementations both called
I'm trying to change the color (material) of an actor that I spawn during gameplay. It works when running on a server but not on a client. (The actor is spawned on the client but the material change is only visible when looking at the actor on a server.) To try to understand what is happening I created 3 functions:
UNFUNCTION(Client, Reliable) void clientChangeColor();
UFUNCTION(Server, Reliable, WithValidatin) void serverChangeColor();
My changeColor function calls both clientChangeColor and serverChangeColor. I put a breakpoint at the beginning of clientChangeColor_Implementation and serverChangeColor_Implementation thinking that one or the other will get hit, depending on whether I'm running a client or on a server. But on both client and server both breakpoints get hit every time. How is this possible?
asked May 27 '15 at 05:01 AM in C++ Programming
Since your actor is owned by the client this is the behavior. See: https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/RPCs/index.html
There is a table there. If you invoke a function from the owning client to the server or client it gets executed on client/server.
answered May 27 '15 at 06:18 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here