Outline of component

Hello, I need to make an outline of one mesh from several located in the same blueprint. It’s should looks like selection in Unreal Engine editor:

Also, I have a rotation logic code, which, i dunno, may interfere with clicking on the mesh:

How to make it correct? If you need more information, please, tell me.

Hello @SeriousTMG how are you??

I’ve been trying to make this work and I found a way to do it!

First of all, you need to create a Material to use as an overlay. You can do it by following this tutorial.

The next step y to setup your actor!

  1. Add as many Static Meshes as you want but make sure they are all childs of the DefaultSceneRoot;

  2. Create a variable of type “Static Mesh Component”, I’ve called it “Selected Mesh”.

  3. Create a custom event with an input of type “Primitive Component”.

  4. Then put the following logic into your custom event:

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!