We create a widget in the class Pawn. Pass the widget to the variables, in the widget, we perform calculations and output to the screen. We have an error in the process of work. As we can judge the calculations are correct.
(variables in companets have the meanings)
(variables between Pawn and the widget are linked)
The server doesn’t have a HUD so you need to check what you are running on before doing any HUD work. You can set up a Branch and feed it the result of IsLocallyControlled. On True, do the HUD work.
This will prevent the server from creating a HUD but it will also prevent other pawns (other players and/or AI) from affecting the HUD of the local player.
The widget connects in several Pawns, the variables in them have different meanings. How you can attach a widget to the HUD, while leaving the variables to the widget in Pawn?
I’m not sure I understand you but it sounds like you want non-local pawns to affect the HUD. In that case don’t use IsLocallyControlled but instead use SwitchHasAuthority and run the HUD-related code from the “Remote” execution pin.
Thanks for your answer, you’ve been very helpful. Now we have a little problem, we need to do all the calculations on server, and the client to ban any actions with calculations.
I don’t think I understand. If you need to move functionality from the client side to the server then how to do it will depend on the functionality. I assume you know how to make a server RPC. Beyond that, I’m not sure what to tell you.