From Client to Server (Owning Problem ?)

Hello,

After some days in the dark I want ask you how do you communicate from client with server ?


I try to simplify my problem at most :
I’m started from the puzzle blueprint sample and remove the actors : block and blocGrid.

And I add my actorTest in the level : [actorTest.uasset][1]

This actor is replicated and I would like make it react to client click as well as server click but that what I got : [quickDemo.gif][2] The client doesn’t call its server.

On the event graph of this actor, I create a replicated function to call server from client and modify an replicated (RepNotify) variable “varForUpdate” (to updates all clients in return), but it doesn’t work.

79848-repnotify_variable_varforupdate_1.jpg

Can you explain me where I’m wrong ?

I should add that the client print says “client -2 : …” as if he really don’t know where it came from.
And if this is a an “Owning problem” I must admit that I don’t know how to fix it and need some help.

Thank you.
Julien.

I think I have pretty much answered my question.
In my PuzzlePlayerController EventGraph, I need to find actor test and set correctly his owner :

And I just remove a redondant update function (Update Actor) in my ActorTest EventGraph :

Now it works but I don’t understand why when I click with the client the print message is always “Client -2” instead of “Client 1” ?

Does someone have an idea ?
Thank you in advance.
Julien.

Correction : In fact it doesn’t work :frowning:

When I have 3 or more players (1 server and at least 2 clients), only the last client back the info to the server…

I don’t understand because the owner is well set for each client.
Will someone tell me what I forgot ?

Thanks.
Julien

Now I resolved my problem.

To resume, In my “PuzzlePlayerController” EventGraph, I just need to add the “left mouse Button” event and use the function “Get Hit Result Under Cursor By CHannel” and test if result correspond to my target object (Sphere component of my “actorTest” here).

And from this I place my RPC Event “Run On Server”, in my player controller, and call update function of my selected object “actorTest”.

It work in that way but I’m not sure if that’s the best way.
Julien.