#Solved - Abilities calling twice on cleint

18 messages ยท Page 1 of 1 (latest)

ionic musk
#

This ability was created to apply a GE to a target under mouse. In this video I have it adding 50 str on application. However it was adding 100 str instead as the ability was being called twice on the client. I added a delay node at the end of WaitGameplayEvent to fix. If anyone knows a more concrete solution or could even explain why thats happening please let me know.

gray hollow
#

The code contains server check into C++ side, which prevents FireBolt from running from the client. In Electrocute we have other check in Blueprint side. The fact that the client performs actions without waiting for the server, it's good, but accrue any reward or damage should only the server.

ionic musk
#

ohhh ok so Ill try applying some HasAuthority nodes and see if that fixes it. Thanks Sergei!

gray hollow
#

Also you can specify into GameplayAbility property for run from server only, if you have case where you have not reason for run on client side. Right now you use AnimMontage and i think, you want block from client last node only. In Passive Ability we use server side only (see screenshot)

ionic musk
#

worked like a charm. thanks man!

#

yea this is much more reasuring than a delay node lol

gray hollow
#

I'm not sure, but I think AnimMontage terminates right after the Event, and that causes EndAbility. Try removing EndAbility node. Will double accrual then occur when there is a delay (with old way without server check)?

ionic musk
#

like this? this cause double cast yes

#

second screenshot works if thats what you meant but, it also works with end ability hooked up. The key seems to be the delay node and the HasAuthority and HasAuthority just seems safer to me

gray hollow
#

Yes, so my assumption is correct and the delay was helping to end abilitiy earlier than accrue on the client repeatedly ๐Ÿ™‚ Glad to be of help

ionic musk
#

Yes, thank you again! Much appreciated

#

Solved - Abilities calling twice on cleint

gray hollow
#

One more idea. Put EndAbility after Apply Effect, so that you don't rely on the length of AnimMontage. It is possible to leave only for the last 2 pins EndAbililty (Interupt and Cancel). But expect server-side completion as the base behavior of the ability.

ionic musk
#

like this? This adds it for a split second then removes (str goes to 60 then back to 10)

#

oh and btw I added a HasAuthority node in our GA_firebolt because our C++ wasnt actually preventing it from hitting our Spawn Projectile node twice. So thanks now I will ad HasAuthority to all my abilities pretty much

gray hollow
#

Yeah this was a bad idea ๐Ÿ˜ That makes sense, the effect lives as long as the abilitiy lives. I've just finished the course myself and haven't quite got to grips with all aspects of yet ๐Ÿ™๐Ÿป