For this documentation, I will be using the third person project template
If you haven't looked at the Overview page, I recommend you take a look, as here I will skip some steps that I already explained on the Overview page.
We will focus on making a light that turns on and off when we interact with the lamp, this lamp is included in the "StartContent" folder that you can include in your project, but it does not necessarily need to have this lamp, it can just be a light that will turn on and off, the focus is to understand this side of the interaction system.
I will create a child of the Blueprint that is already included in the project, but you can use the one you created in the Overview window.
Don't forget to adjust the values of the player component variables, if you created another base, put it in the "Base Class To Interact" variable, in my case, I will leave the variables adjusted as shown in the image below:
Remember, Area interact will only work if the object is a child of a base blueprint, and that base needs to be referenced in the player component.
The base blueprint is located in the "Base Actor" folder, in the interact system assets folder.
Right-click on the base blueprint and create a child of that blueprint.
Rename the child that was created.
Adjust how your lamp will be, mine looked like this:
Adjust the light intensity to zero.
Click on the component and then press "Interact Event", this will create the event for when we interact with this object.
And this is the logic of the lamp:
(The boolean defaults to false)
Now that the object is ready, let's change some settings.
In this step of the documentation, I will make different configurations in copies of the same object.
Let's start with the simplest one, one that will display text when interaction is allowed.
Drag the lamp into the world and position it where you want it. Then adjust the object's variables according to the table below: Only change the variables in the table; you don't need to change the others for now.
Variable name | What to adjust |
---|---|
Interact Mode | Area Interact |
Area Collision Type | Sphere |
Area Transform | I set 5 for all scale axes |
Can See Area Interact In Game? (Area Interact) | ✅ |
Widget Mode | Use Only Text |
Widget Interact Transform | 50 in Z Axes location |
Put Text Here | Press “E” To Interact |
Set Font Format And Size | Adjust the font to the format you prefer |
And now you have the first lamp, let's move on to the next one!
For this object, we will only use images and with the Pre Interact area active.
If you look at the "Textures" folder that is included in the Interact System Folder, you will find some images that I have already prepared, obviously you can choose any other image if you don't want to use these.
I will use these images to make the next objects.
Change the variables according to the table below to build the next lamp.
Variable name | What to adjust |
---|---|
Interact Mode | Area Interact |
Area Collision Type | Sphere |
Area Transform | I set 7 for all scale axes |
Area Pre Interact? | ✅ |
Area Pre Interact Size | 2.1 |
Can See Area Interact In Game? (Area Interact) | ✅ |
Widget Mode | Use Only Image |
Widget Interact Transform | 50 in Z Axes location |
Set Interact Image | Place the image referring to the interaction button, and adjust the size of the image, I adjusted 80x80 |
Set Pre Interact Image | Place an image that shows the player that he can interact with this object, I was inspired by games like COD and Resident Evil for this Pre Interact Icon, and I adjusted the image size to 80x80. |
And we have our second lamp configured!
This mode already makes the system more interesting, let's configure it.
Again, follow the values in the table below:
| --- | --- |
We have another lamp!