Skip to content

Local GameplayCues using AvatarActor to emulate properly the behavior of a normal GameplayCue#118

Open
linqen wants to merge 1 commit into
tranek:masterfrom
linqen:linqen-patch-gameplaycuelocal
Open

Local GameplayCues using AvatarActor to emulate properly the behavior of a normal GameplayCue#118
linqen wants to merge 1 commit into
tranek:masterfrom
linqen:linqen-patch-gameplaycuelocal

Conversation

@linqen

@linqen linqen commented Aug 29, 2023

Copy link
Copy Markdown

The current behavior of the example GameplayCueLocal functions is not working as it would do with a normal GameplayCue.

If we use GetOwner, the gameplay cue will always be executed sending the owner as "MyTarget", inside the GameplayCue.

In case our ASC lives on the PlayerState, and our Character is the Avatar, this will result on inconsistent behavior between executing the GC using this new function, and the normal Execute/Add GameplayCue

GetAvatarActor() instead of GetOwner() fixes this issue.

Check UAbilitySystemComponent::InvokeGameplayCueEvent to confirm that this is the default/expected behavior.

… of a normal GameplayCue

The current behavior of the example GameplayCueLocal functions is not working as it would do with a normal GameplayCue.

If we use GetOwner, the gameplay cue will always be executed sending the owner as "MyTarget", inside the GameplayCue.

In case our ASC lives on the PlayerState, and our Character is the Avatar, this will result on inconsistent behavior between executing the GC using this new function, and the normal Execute/Add GameplayCue

GetAvatarActor() instead of GetOwner() fixes this issue.

Check UAbilitySystemComponent::InvokeGameplayCueEvent to confirm that this is the default/expected behavior.
@linqen
linqen marked this pull request as ready for review August 29, 2023 17:23
@linqen

linqen commented Nov 29, 2023

Copy link
Copy Markdown
Author

@tranek is it possible to take a look at this? I think just looking at the code makes completely sense.

GetAvatarActor will return the same as GetOwner when the Owner is AvatarActor, but will also return the proper actor when Avatar != Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant