Hey All, I’ve been banging my head against a wall for a couple days now trying to figure this one out. Hope someone here can help.
Intent:
In a MP environment have a button that a client or server can use that performs an action on an actor in the environment.
What I’ve done:
I’ve tried dumbing it down to the simplest form.
-created a replicated blueprint actor called buildingtest
-created a button with an overlap event and a replicated variable that allows me to place the buildingtest and button in the level and target the button to the buildingtest
-created an input mapping for UseButton “F”
-In the button’s event graph, enabled input off the overlap event
-In the button’s event graph, created a custom event that runs on server to destroy the buildingtest that the button points to
-In the button’s event graph, call the destroybuilding custom event when the UseButton input action is executed
Result:
Server can use the button and destroy the building. Server and Client both see the building get destroyed
Client CAN NOT destroy the building
If client is overlapping the button, Server CAN DESTROY BUILDING even though the server isn’t overlapping.
General thoughts:
If I run a generic “hello” log off the UseButton input action, the client can use the button and spam Hello. (However the server can also spam when the client is ovelapping)
If I call the destroy building custom event after the enable input node, the client will destroy the building when they overlap the button
It feels like I need to somehow define the overlapping player, (perhaps cast to the player character from the overlap and enable the input there?) but I’ve been unable to find any reference/tutorial that sheds any light on this.
Any help would be greatly appreciated.