Gameplay Ability System: Difference between revisions

From Unreal Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:


==Notes==
==Notes==
If you get the error failed: AbilityActorInfo.IsValid(), then you need to do your AbilityInit logic in the BeginPlay<br>
If you get the error failed: AbilityActorInfo.IsValid(), then you need to do your AbilityInit logic in the BeginPlay Function<br>
as adding this line AbilitySystem->InitAbilityActorInfo(this, this); to the construct will fail because your actor<br>
and not somewhere like the constructor(like I did) as adding this line AbilitySystem->InitAbilityActorInfo(this, this); <br>
isn't initialized fully yet<br>
to the construct will fail because your actor isn't initialized fully yet<br>

Revision as of 04:03, 1 March 2025

Mainly learned from this page https://landelare.github.io/2024/01/15/simple-gas-tutorial.html

The Gameplay Ability System (GAS) Is used Primarily for its Network Prediction, It does provide other uses, however its much simpler to build your own system

1. To Start enable the Gameplay Ability System Plugin

1.1 Restart the editor, and build the project in c++(Note if you do not restart the editor you will have build errors)

1.2 I had issues building with the editor open if you have errors try keeping the editor close while building?

1.3 cannot open source file "AbilitySystemInterface.h"

I was able to resolve the issue by generating Visual Studio project files. I’m not sure why there would be a compiling issue if that’s all it took to fix things, but so it goes. Thanks to Kazuja on the reddit post for running through his steps with me:

Also thanks for starting to assist me here.

To resolve the issue, I opened the project folder within my UnrealProjects directory, rick-clicked on the .uproject, and clicked on “Generate Visual Studio project files”. After reopening my project in the editor and the solution in VS2017, the problem was fixed.

For me I always had to close the editor

2. Add it to your Games\Source\<Project>\<Project>.Build.Cs

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "EnhancedInput" , "GameplayAbilities" });

3.

Notes

If you get the error failed: AbilityActorInfo.IsValid(), then you need to do your AbilityInit logic in the BeginPlay Function
and not somewhere like the constructor(like I did) as adding this line AbilitySystem->InitAbilityActorInfo(this, this);
to the construct will fail because your actor isn't initialized fully yet