Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

linqen
Copy link

@linqen linqen commented Aug 29, 2023

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
Copy link
Author

linqen commented Nov 29, 2023

@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