help making RPC work

I started a new thread because I just need to finish understanding how RPC works.

I want to parse a value (vector) from a client to the server I am not being able to success.
Then I am just trying something more basic…just try make the client ask the server to say ‘hello’…I want to communicate from client to server. This is the most basic attempt I can do and is not working.

please help.

Actor rep settings:

run on server function settings:

image

thanks

Hi @eldany.uy ,

What class are you attempting to call that function? If you don’t have either authority or autonomous proxy as your NetRole then that server call is going to be dropped. I’m sure you’re familiar with this page but there is a table describing where RPC’s will run based on ownership.

Offhand, I’m not sure if that macro handles autonomous proxy. Which would be the case on your PlayerController and possessed Pawn if you are the owning client. If the class you’re making your function is either of those classes you may want to try something like “IsLocallyControlled” iirc

Thanks man. Actually the problem was I was trying to make the ‘call from server’ event from the actor thinking it was the owner as only client owner can make the action but the real owner is player controller so when I invoke the call from PLAYER CONTROLLER it works as expected.

Its a bit silly there is not some warning from the engine like it does when you cast the same class saying ‘hey bro…this is not the client owner, try from playercontroller’

2 days to figure that out.

Ownership is normally set at runtime.

A warning is printed in the log every time you attempt to call a Server RPC on something you don’t own.

No owning connection for actor

1 Like

thanks. I will pay more attention to the log

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.