tranek / GASDocumentation

My understanding of Unreal Engine 5's GameplayAbilitySystem plugin with a simple multiplayer sample project.
MIT License
4.26k stars 789 forks source link

PlayMontageAndWaitForEvent doesn't work on clients #111

Open tommygod3 opened 1 year ago

tommygod3 commented 1 year ago

When playing as a client, PlayMontageAndWaitForEvent::OnGameplayEvent is sometimes not called. When this happens, it results in the FireGun ability not spawning any projectile on cast:

https://user-images.githubusercontent.com/32672006/226472108-d6e5efa6-d430-4362-ab47-d49be440ebb9.mp4

This can be recreated with relative consistency in the PIE by playing as a second player and using a listen server. When packaging the game and playing over a real network, the result is much worse and the client is hardly able to spawn any projectiles at all (as seen in video).

I have tested this on 5.0 branch and version and it doesn't happen there, so it seems like it might be an engine issue?

Any help would be greatly appreciated, love this project and have been using PlayMontageAndWaitForEvent a lot!

tommygod3 commented 1 year ago

Have also tested on 5.2 and issue still present

tommygod3 commented 1 year ago

@tranek any thoughts? Would appreciate some advice as this basically makes PlayMontageAndWaitForEvent unusable

tranek commented 1 year ago

I isolated it down to the call to StartAimDownSights(). I don't know why this is breaking it. Unhook the call to that node in the ADS GA and it works fine. There might have been changes to the CMC that need to get propagated to the ADS slow movement speed implementation.

The issue is also seen while sprinting and firing because of the customizations to the CMC.

This applies to any AnimNotifies, not just the GameplayTag events from PlayMontageAndWaitForEvent and it is also an issue with the built-in PlayMontageAndWait AbilityTask.

I don't have time to investigate any further right now.

image

hamar02 commented 1 year ago

i also have this issue, any fix yet?

quifi commented 9 months ago

Have the same issue. After some digging (which is also a good practice to understanding GAS), it seems the problem is caused by EndAbility with bReplicateEndAbility=true in UGDGA_FireGun::EventReceived. After passing bReplicateEndAbility=false, FireGun works smoothly.