Advanced Interact System

What will be the objective.

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.

Captura de tela 2025-01-22 163510.png

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:

Captura de tela 2025-01-22 165649.png


Creating a new child object

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.

Captura de tela 2025-01-22 173021.png

Right-click on the base blueprint and create a child of that blueprint.

Captura de tela 2025-01-22 173114.png

Rename the child that was created.

Captura de tela 2025-01-22 173153.png

Adjust how your lamp will be, mine looked like this:

Captura de tela 2025-01-22 173517.png

Adjust the light intensity to zero.

Captura de tela 2025-01-22 174805.png

Click on the component and then press "Interact Event", this will create the event for when we interact with this object.

Captura de tela 2025-01-22 174122.png

And this is the logic of the lamp:

(The boolean defaults to false)

Captura de tela 2025-01-22 175206.png

Now that the object is ready, let's change some settings.


Adjusting values to interact with the object

In this step of the documentation, I will make different configurations in copies of the same object.

-Text only and no Pre Interact.

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!

Captura de tela 2025-01-23 202933.png

1-ezgif.com-optimize.gif


-Only image with Pre interact

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.

Captura de tela 2025-01-23 204859.png

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!

Captura de tela 2025-01-23 210725.png

2-ezgif.com-optimize.gif


-Both modes and with Pre Interact

This mode already makes the system more interesting, let's configure it.

Again, follow the values in the table below:

| --- | --- |

We have another lamp!

Captura de tela 2025-01-23 214455.png