RPC in Character Actor Component

I have a blueprint interface for handling interactions that I have added to my character. The interface includes a RPC to the server and within the RPC sends a call to the actor interacted with. The problem is the RPC isn’t running for clients. This is probably an ownership issue, but if the interface is within the character shouldn’t the player be the owner?

Hey @Space_Grouse

Sounds like a problem with the ownership like you said. It’s the first time I heard someone trying to add the RPC on the interface. Is not better a component in this case?

Anyway, I am not sure if I understand correctly you are sending an Server_RPC from the owned client to the server and then are you sending another one after the interaction?

Do you mind to share you character code?
If you do it will be great if you can add comments like “this is not being called on clients” or something like that.

You should be having the server do it’s own interaction.

You interact: successful and valid → RPC Server
Server interact: successful and valid → does the authoritative stuff… interface actions.

Don’t pass references to the server. It opens the game up to cheating.

My apologies, I meant a blueprint component. That’s what I get for asking questions on the forum during my day job.

Here’s the interaction input in the interaction blueprint component

This is the interaction received by the other actor (vehicle in this case) that isn’t working because I don’t receive an interaction from the server.

And I think I should actually be doing it sort of like this in the vehicle blueprint.

So instead of having my trace on the input, I’ve got it on tick within the blueprint component so that it automatically shows UI when an item is interactable. I’ve always avoided tick, but I was told it was fine in this case.

Here’s my trace script. This sets the interactable actor (for the interaction input) and updates a widget prompt.

I tried running the trace on the server, but that didn’t seem to help.

I use a collision component (capsule) attach to camera. It overlaps and triggers BPI events on the other actor. UI stuff. Server/sim proxies don’t do this. Technically they shouldn’t have the components to do so. I remove it on spawn from server and sims. And cameras from sims.

The Input action is the request to “attempt to” pick up item, get in vehicle, open door.

Got it! The actor I’m interacting on wasn’t being set on the server. After that I made these changes in the blueprint component. Also you said not to pass variables to the server, so I think I’ve got that right now.

And now in the vehicle I’ve got this, and things are working properly (second player interacting is taking the passenger seat)