As you can see, the first thing you do is to check if the selected mesh is valid (if there is a mesh already selected) and you deactivate its overlay material. Then, you cast the “Primitive Component” to “Static Mesh Component” and set the new mesh as selected mesh. After that, you assign the corresponding Material as overlay for that mesh.
The last part is to create a way to select the meshes! In my example, I’m doing it by using a “line trace” from the camera. This is the code you need to implement in your Character Blueprint.
The important part here, is that the “Hit Component” will give you as a result the primitive component that has been hit by the trace. That’s the reason why we cast it to Static Mesh Component in the Actor blueprint. And we use the “Hit Actor” to call the corresponding Select Mesh function.
Here is a video of this method working:
Hope this helps you! Let me know if you need more help!