-
Notifications
You must be signed in to change notification settings - Fork 1
Gameplay Interaction Setup Guide
Step 1: Download the Gameplay Interaction plugin from the Epic Games Launcher for whatever engine version you wish to use from 5.2 and above.
Step 2: After downloading, you can find the plugin in the following directory:
{EngineDirectory}/Plugins/Marketplace/GameplayInteraction
Step 3: Make sure your project is closed (the editor is not running), then copy the GameplayInteraction plugin folder to your project and paste it inside the Plugins folder.
-
Note: Create the
Pluginsfolder if it does not exist already, and paste theGameplayInteractionfolder in there.
See the image below for reference:
Step 4: Open your project in Unreal Editor, and go to Edit > Plugins > Gameplay category. Ensure that the plugin "Gameplay Interaction" is enabled. If it's not, click on the enable checkbox to the left, and you might be prompted to restart the editor.
See the image below for reference:
Note: Also, make sure the Gameplay Abilities, Enhanced Input, Common UI, Modular Gameplay plugins are enabled in your project.
Step 5: Now let's get to the implementation. If your project is a Blueprint project (does not have C++ code), you will need to do this step to make it a C++ project.
Go to Tools > New C++ Class and choose PlayerController and another new class for PlayerState, or whatever class you would like to use for the Gameplay Ability System component, which is required to use the Gameplay Interaction plugin.
Note: For multiplayer games, it's recommended to put the Gameplay Ability System component in the PlayerState or the Character (I prefer PlayerState). For single-player games, it probably does not matter; you can even put it in the PlayerController class.
I'm going to use the player state in this case.
See the image below for reference:

Step 6: After adding the C++ class for the Gameplay Ability System component (in this case, I used the PlayerState class), let's go ahead and edit the code. You will need to have an IDE set up on your computer to edit and compile the C++ code. Visual Studio Community edition is popular and is what most people use. I personally prefer JetBrains Rider IDE.
Step 7: Now that your project is open in the IDE, navigate to Games > YourProject > Source > YourProject > YourProject.Build.cs file.

Step 8: Now open YourProject.Build.cs and add the following module dependencies: "GameplayAbilities", "EnhancedInput", "GameplayInteraction", "Modular Gameplay", "Common UI".
See the image below for reference:
Step 9: Click "Save All" in your IDE, then close the IDE and Unreal Engine Editor. Next, navigate to your project folder, right-click your Unreal project file, and choose "Generate Visual Studio project files."
See the image below for reference:

Step 10: Now, open the project in your IDE again by double-clicking on the YourProject file (not the Unreal Engine editor file, but the one for your IDE such as Visual Studio or JetBrains Rider).
Step 11: Now, let's open the class we added—in this case, I added the PlayerState—and set up the Gameplay Ability System component.
See the code below for reference:

Step 12: Now, let's initialize the Gameplay Ability System. To do this, we will need to create a character class (or a pawn class if your project does not use the character class). You will need to compile the current code to open the Unreal Editor and add a Character C++ class to your project. You can press the green triangle button to compile and start the unreal engine editor from your IDE (Or simple click save all and then open the editor from your project folder and it will automatically compile the code)
See the image below for reference:

Step 14: In the Unreal Editor, navigate to Tools, select Character Class, and then click Next. Give it a name and press Create Class.

Step 15: Close the Unreal Engine Editor and return to your IDE. You should see the new Character class added there. In that class, you will need to add some functions needed for Gameplay Ability System initialization.
Gameplay Interaction Plugin Has 2 Components, One component is a controller component which can be added to PlayerControllers or AIControllers And the second component is for interactive entities or actors that the player or AI can interact with.
Advanced Implementation From Demo Project Essential Classes Needed for the Gameplay Interaction Plugin to Function Properly (Available for Reference in Demo Project)
-
UnifyAbilitySystemComponent.handUnifyAbilitySystemComponent.cpp -
UnifyGameplayAbility.handUnifyGameplayAbility.cpp -
UnifyInputConfig.handUnifyInputConfig.cpp -
UnifyInputComponent.handUnifyInputComponent.cpp -
UnifyCharacter.handUnifyCharacter.cpp -
UnifyPlayerController.handUnifyPlayerController.cpp -
UnifyUIManagerSubsystem.handUnifyUIManagerSubsystem.cpp -
UnifyActivatableWidget.handUnifyActivatableWidget.cpp -
UnifyGameViewportClient.handUnifyGameViewportClient.cpp -
UnifyHUDLayout.handUnifyHUDLayout.cpp -
UnifyHUD.handUnifyHUD.cpp