When the player presses shift + space their character will dash. I am using a timeline for this and it replicates perfectly. My issue is that after the timeline finishes I need to check if the player is still holding the shift key (sprinting) to determine what the character speed should be after dashing.
The branch checking the “Sprinting?” Boolean is coming after a multicast custom event, and it works for the clients so long as I run it through a “switch has authority” node, but only if I leave the “authority” output blank. But obviously this will not work for the server player.
If I plug the “authority” output straight into the multicast, bypassing the server replicated custom event (which is how I have been successfully replicating everything else thus far) it works for the server, but breaks and always returns false for the clients.
Dash input → switch has authority (remote): Do your local logic, Then call Server Dash.
Server Dash (run on server) → Mutlicast Event.
Leave the Authority exec pin empty.
If you are using the Character Class (character movement component) then you don’t need to mutlicast. Just call the server dash event and it’ll replicate the movement.
If I built the game with the option of private lobbies that people can host and join, won’t I need the authority exec pin to work also for the hosting player?
Did not work. It seems to be a replication issue despite the client executing a server custom event. The server thinks the client is still sprinting (holding shift) and is correcting the client’s movement speed. The odd thing is the client does not have an issue replicating its movement speed when no dash is executed. Pressing and releasing shift works fine. But releasing shift after the dash does not replicate the change. Simply pressing and releasing shift after the dash will correct the issue and get the client and server on the same page.
I printed the boolean and the server and client are both responding correctly. The server does not print when the client shows false, and vice versa.
Does the server event → multicast event upstream have anything to do with it? I’ve done it elsewhere and it works fine.
EDIT
I had a thought- the sprinting set false/true is happening elsewhere on the event graph when shift is pressed/released. Perhaps there is a timing issue with shift being released mid dash, and the client is not replicating the sprint set=false soon enough by the time it is being checked by the dash event? (The dash event is a pressing space event, the set sprinting true/false is a pressing/releasing shift event)