Gameplay Abilities: TryActivateAbilityByClass results error
So.. here is the problem:
I have dedicated server.
Warning: Can't activate LocalOnly or LocalPredicted ability Default__GA_BasicMeleeAtack_C when not local! Net Execution Policy is 0.
and ability doesn't work.
(btw. dedicated server doesn't have sessions set up, client connects by IP)
After some digging i found:
Net Execution Policy is Local Predicted.
So i think something wrong with PredictionKey... and my skills not enough to find out whats wrong..
so i added to plugin this:
and getting false.
So how to fix this key stuff?
This is how ability is acquired:
Also i overridet PossessedBy so after possession information is refreshed:
asked Apr 15 '19 at 10:35 AM in C++ Programming
in guides i red that you need to refresh actor info after possession and override PossessedBy function... But problem is that PossessedBy is called only on server... So i tried refresh actor info before activate ability on client and ability STARTED to work. Last thing for me.. decide where exactly to put RefreshActorInfo so it will be called on server and on client...
answered Apr 19 '19 at 08:10 AM
Found it ! you call AbilitySystem->InitAbilityActorInfo(this, this); only on the server, put it in begin play !
because your client has no actor infos, so when it try to look if it's a local player, it's can't know ( so it answer false )
answered Apr 18 '19 at 11:07 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here