Skip to content

Gameplay Interaction Setup Guide

Nazake edited this page Aug 9, 2024 · 24 revisions

Downloading and Locating the Gameplay Interaction Plugin

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

Capturewwww

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 Plugins folder if it does not exist already, and paste the GameplayInteraction folder in there.

See the image below for reference:

dwdw qqqq

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:

www

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:

347748980-aafafbf3-5a04-445a-8783-5ded7ba0b83f 347749981-69aa4067-e8f6-4af1-ae61-79318dbbb8e9

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.

347753652-7fb88e49-4d26-4650-939a-f5639058d607

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:

dwdwdwd

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:

347755028-91a5e82f-2585-4ef1-ae36-41cea81149ac

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:

347759077-516be33f-605c-4b5d-8859-49d9d7b5e94b 347759182-deaf5652-9612-4ac2-a855-5cfa59e6a0df

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:

347762291-d69e0f3a-575f-49d1-9c0f-181e35c826ef

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

347763190-8ef4d8e3-0a0a-4de3-ba67-630f4f2b541d 347763199-d946fc7c-d53b-4384-a2ea-6ddb50caf12f

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.h and UnifyAbilitySystemComponent.cpp
  • UnifyGameplayAbility.h and UnifyGameplayAbility.cpp
  • UnifyInputConfig.h and UnifyInputConfig.cpp
  • UnifyInputComponent.h and UnifyInputComponent.cpp
  • UnifyCharacter.h and UnifyCharacter.cpp
  • UnifyPlayerController.h and UnifyPlayerController.cpp
  • UnifyUIManagerSubsystem.h and UnifyUIManagerSubsystem.cpp
  • UnifyActivatableWidget.h and UnifyActivatableWidget.cpp
  • UnifyGameViewportClient.h and UnifyGameViewportClient.cpp
  • UnifyHUDLayout.h and UnifyHUDLayout.cpp
  • UnifyHUD.h and UnifyHUD.cpp

Demo Project

Test the plugins in my demo project.

Documentation

Change Logs

Support

Join us on Discord.

Clone this wiki locally