-
-
Notifications
You must be signed in to change notification settings - Fork 21
How to Setup Interaction
- Download the Plugin
- Instal the Plugin
- Enable the Plugin
- Open the Project
- Before you Start
- Interactor Component
- Interactable Component
If you have already the plugin claimed, simply select the plugin and install it to the Engine version you are working with. Marketplace release always supports the last three major releases according to Epic Games policies.
If you don't see your Engine version listed on the Marketplace, you can always download the GitHub release.
If you feel experimental or simply need an older project to work with, the GitHub release page got you covered. All releases are listed HERE.
There are always two versions:
- ActorInteractionPlugin
- ActorInteractionPlugin_Binaries
The Binaries version skips the code build when opening the project and is recommended for Blueprint-based projects.
Epic Games Launcher does the job for you, so you can continue to another chapter.
With the GitHub release, there are two ways to install the plugin. Both have their advantages and disadvantages.
If you instal the plugin in Game Folder, this plugin will be available for this specific project only. If you are using the Blueprint project, it might require creating a dummy C++ class for packaging.
Installation to Game Folder requires you to drop the plugin into: ...
/ProjectFolder
/Plugins
If you have no Plugins
folder, simply create a new one.
If you instal the plugin in Engine Folder, this plugin will be available to all projects using this Version! With Engine Folder you shouldn't need to create a dummy C++ class for packaging.
Installation to Engine Folder requires you to drop the plugin into: ...
/EngineFolder
/EngineVersionFolder
/Engine
/Plugins
/
Engine is usually installed in: C:
/Users
/{user}
/UnrealEngine
/{engine_version}
If you are opening the project for the first time, you need to enable the plugin in Edit
/Plugins
/Mountea Framework
It will ask you to restart your Editor.
If you are using the GitHub release, the plugin should be installed by default. If not, you need to enable the plugin in Edit
/Plugins
/Mountea Framework
It will ask you to restart your Editor.
If you are opening the project for the first time, you will be greeted by a Welcome Screen
. This popup window shows:
- If you open the project for the first time
- If a new version is released
Welcome Screen
contains useful links as well as full Changelog, so you can see what version with what features.
❗ Welcome Screen
requests those data from GitHub page, so if you have no access to the internet, this popup will not show any Changelog information ❗
Before you start creating any super complex interactions, there are a few steps that must be done. In order to make everything work, you should set up default values and collision channels. So let's start with those annoying configurations before so we can focus on interactions later.
Actor Interaction Plugin can simply work out of the box with collision channels Engine contains by default, but it is much safer to use custom ones. Fear not, it might sound scary, but it is not at all! I have even prepared those collision channels for you!
Open the {project_folder}
/Config
/DefaultEngine.ini
file (works fine in Notepad, but I recommend to use Visual Studio Code).
Search for [/Script/Engine.CollisionProfile]
.
Once you find this part of the config file, all you have to do is to paste the following lines to the very end.
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel1,DefaultResponse=ECR_Ignore,bTraceType=True,bStaticObject=False,Name="InteractionTrace")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel2,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="InteractionOverlap")
+DefaultChannelResponses=(Channel=ECC_GameTraceChannel3,DefaultResponse=ECR_Ignore,bTraceType=False,bStaticObject=False,Name="InteractionHover")
And you have done it!
If you want more user friendly approach, you can do it from the Engine interface. Go to Edit
/Project Settings
/Collision
.
Once there, you have to manually create those three Collision Channels.
Object Channels are the following ones:
- InteractionOverlap
- InteractionHover
Set Default Response to Ignore.
Object Channels are the following ones:
- InteractionTrace
Set Default Response to Ignore.
Interaction Defaults are a useful way to setup default values and have some safe backup if you accidentally break anything. Current implementation uses Defaults for all Components, in the future there are plans to add Presets
, which will be then assignable to Components.
Let's open Edit
/Project Settings
/Actor Interaction Plugin
settings and focus on variables we can set up here. Actor Interaction Plugin
is located at the very bottom of the list, under the Mountea Framework
category.
Globally enables/disables Editor Debug. If enabled, you can enable editor debug for each Component. If globally disabled, local settings are considered false.
Defines "Tick" frequency for widgets. Actor Interaction Plugin is not using Ticks for any component to keep as good as possible performance. In order to achieve smooth animations for UI, this Widget Update Frequency
is used.
It is valued in Seconds, therefore lower the value, the more frequent the update is.
❗ 0.001 is lowest possible value you can set ❗
❗ Very low values might resolve in very poor performance ❗
Widget Blueprint Class which will be used as the Default one.
❗ Only classes which Implement the ActorInteractionWidget
Interface are allowed ❗
Data Table reference which will be used as the default one.
Once all the setup is done, we can finally start using the Interactions Components! And we should start with the Interactor Component, which is easier to set up and doesn't contain that many variables to fiddle with.
Interactor Component
provides the active part of the Interaction process, let's imagine it as the player's eyes. Those can be of course assigned to NPCs as well, as this system is not limited to player input, which allows smart NPC behaviours. There are two master components:
- Interactor Component: DEPRECATED, for legacy projects usage only
- Interactor Component Base: The new system which is recommended to use
For this scenario, I will use Third Person Example
so everyone can follow those steps. Let's open the ThirdPersonCharacter
blueprint. We all should see the same screen as this one.
The next step is to select the +Add Component button and search for Interactor. Actor Interactor Plugin comes with three C++ based classes, which are under the Interaction category and two Blueprint-based classes, which will be under the Custom category. Blueprint classes have BPC prefixes.
Blueprint classes provide the ability to override and extend C++ logic. By default, there is no extra functionality tied to Blueprint classes so it should not matter which one you choose. I will choose C++ class with this example.
You can choose from three options:
- Interactor Component: DEPRECATED, please don't use
- Interactor Component Trace: Basically a tracing laser from a specified location, either eyes or given one
- Interacto Component Overlap: Passive component used to determine whether overlapping is with a collision of Interactable Component
For our example, I will choose Interactor Component Trace. After you select the Component from the +Add Component menu, you need to compile. You should see this screen.
As you can see, there are multiple categories under the Interaction detail tab. The most important ones are all located in the Required category.
To get the best results, let's select Collision Channel and pick Interaction Trace value we have created in the Collision Setup. This way your tracing won't affect any other channels.
Other options can be left as they are. If you are interested in how they work, each of them has an explanation tooltip and Wiki page. So your Interactor should be good to go as it is.
For this scenario, I will create a new Actor to show you the complete setup, however, this logic is translated to existing Actors as well.
Let's create a new Actor and call it BP_InterctableShowcaseActor.
Once you have added the Static mesh, you can add Interactable the same way. +Add Component and select Interactable. Like with the Interactor, there are many options to pick from.
This is the same case we had with Interactor Components. 5 Blueprint classes and 6 C++ classes, where 1 class is DEPRECATED.
- Interactable Component: DEPRECATED, do not use
- Interactable Component Auto: Does automatically finishes interaction, no input is needed. Useful for Capture the Flag and similar gamemodes.
- Interactable Component Hold: Requires input to be held for a specified duration, key E on a keyboard for 3 seconds, for instance.
- Interactable Component Hover: WIP component which should be working with top down gamemodes and should only react to coursors.
- Interactable Component Mash: Requires multiple inputs to be pressed within a specified time frame.
- Interactable Component Press: Requires input to be pressed.
For our example, I will choose Interactable Component Hold. After you select the Component from the +Add Component menu, you need to compile. You should see this screen.
Similarly to Interactor Components there is Interaction Category with Subcategories where all variables are displayed. Interactable Components are different to Interactor Components, because Interactable Components have transforms, while Interactor Components are just attached to the Actor. Interactable Components, on the other hand, can and should be positioned where they belong.
To change the transform of the Interactable Component use the Gizmos. Once you move the Interactable a bit up, you can see that there is Billboard, which shows you where exactly the Component is. This Billboard is visible only in Editor.
Same as with Interactor Components, the most important ones are all located in the Required category in the Interaction category. And in the same manner you have setup the Interactor Trace Component, you should setup the Interactable Component. So update the Collision Channel to use InteractionTrace channel and compile.
Once done, there are two last things to do in the setup to make the interaction work. Those are:
- Interactable Data
- Widget Class
Let's go one after another.
Interactable Data is a way to provide a modular aproach for setup. All you need to do is to create Data Table (or prefererably duplicate the one which comes with the Plugin) and fill that table with values. You can find Interactable Data under Optional category.
- Converted to PDF using https://www.markdowntopdf.com/