tranek / GASDocumentation

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

Add another reason to the warning mentioned in section 9.1 #60

Closed RapidFire05 closed 3 years ago

RapidFire05 commented 3 years ago

9.1 LogAbilitySystem: Warning: Can't activate LocalOnly or LocalPredicted ability %s when not local! You need to initialize the ASC on the client.

You may also get this warning if you have a local only ability that you grant on the server and try to activate on the server.

tranek commented 3 years ago

I don't get that warning when trying to activate a LocalOnly ability from the server. Testing with the meteor ability from this sample project.

image

image

ameaninglessname commented 3 years ago

Seeing from UAbilitySystemComponent::InternalTryActivateAbility, it is strange that you don't get a warning log. The only reason for that is "bIsLocal" is true... on server...

RapidFire05 commented 3 years ago

I'll check your example and double check my code. Maybe I didn't have the bAllowRemote on. Should be able to look at it today.

RapidFire05 commented 3 years ago

Just checked again with your example and another one of my own and am NOT getting the warning. So must have been something else. But seems to be gone now. I think what was happening was I was running into some race conditions. I was previously granting ability then activating (if passive) in subsequent BP nodes. I recently changed my passives to activate in GA::OnAvatarSet.

I tried many different permutations of ways to activate and was not able to recreate the warning so I believe it is fixed. Probably do not need to add anything to section 9.1.