Hi All,
I am trying to create a multiplayer game which has Sword attacks. The Sword is a separate class that has a BoxComponent. I added a function on the BeginOverlap of the Sword on the server as below
In the OnSwordOverlap method, I tried applying damage using UGameplayStatics::ApplyDamage and AActor::TakeDamage (not together)
In the Character Class, I am binding a method to OnTakeAnyDamage as below
Inside the ReceiveDamage I am trying to access the GameMode using
GetWorld()->GetAuthGameMode()
but this returns nullptr when the character is swinging the weapon and the Overlap event occurs.
Edit: The sword overlap and the damage works fine when not swinging (default position)
Any Idea on how to approach this?