Highlight Actor Using Raycasting _ Building system UE5

Hello!

I’m working on a simple building system in Unreal Engine 5, so I’ve been following a bunch of tutorials on youtube because I’m a noob.

At one point I would like to be able to highlight an object selected using raycasting and unhighlight this object when it’s not anymore in the line of sight.
SO here is the blueprint I have from now.


So here the BP_InventoryClass I’m casting to is just a parent class containing other inventory Blueprint with static mesh. Inside of these child (children?) I actually have this blueprint :

The mesh BP actor variable contain the same static mesh as the Blueprint

The problem is that I would like to be able to create a new mesh to add to the actor, when ever this actor is raycasted. This mean finding a way to obtain the reference to the blueprint raycasted containting the static mesh on top of which an identical static mesh with a different material is created. And deleted when the mesh is no longer raycasted.

And then when this will be done, the player will be able to right click and open a simple menu to cut/duplicate the object.

So if anyone has any clue one how to get the “identity” of the actor raycasted, I am veery interested !

Thank you for your help,

Gaston