Interact with actor in both server-side and client-side

I’m a little confused with replication yet…
I can’t interact with campfire by client… only by server
If i try to own the campfire(client), when other player get in, this player will be new owner and the previous player will not be able to interact
I want any player be able to interact whatever if is the owning of the campfire or not

Can anyone help me?



image
image

Hi, do the RunOnServer event inside your player controller, then do the rest server side.

So e.g. from your E pressed event, do RunOnServer and then run the rest of the code you have there (and replace the GetPlayerCharacter with GetControlledPawn).

Or you could also do it on the client until after the linetrace, and then use a RunOnServer event and put the HitActor through that, then do the rest on server.


So you should not have any RunOnServer event inside your CampFire Actor.