Interaction On Owning client

Hello everyone , I have a battery system for my classic torch, but when it is switched on it uses up the battery and I have to find some to recharge my torch. It worked perfectly before I redid my client side interaction system which was simply Presse F —> line trace → BPI_Interact, for ownership reasons, my client interaction is now Run on Server which is causing me problems with my battery system which was not RPC as each player manages their batteries on their own. So now when a client interacts, the battery is also added to the server player, I leave you a screen
What I’ve already tried

  • Event_Interact → Run_Server_AddBattery -->OwningClient_AddBattery
  • Event_Interact → Run_Server_AddBattery
  • Event_Interact → OwningClient_AddBattery
    Without Result I’m a bit lost.

all interaction should be on server, therefore you dont want your widget logic there as its client side

the basic process, player interacts, server adds battery, battery is RepNotify,
in the OnRep event update your widget

1 Like

Hello thank you for your reply, I tried Run on server + CurrentBattery RepNo and same result the client interacts and adds the battery on the server player, I do not understand why it does not add it to its own variable, knowing that
The lamp is part of the Blueprint character
The variables are declared on the Bp_player


on your top pic you’re using GetPlayerCharacter(0) that will always be the server.

what you can do is add an input variable to your EventInteract, either the player or pawn that is interacting

1 Like