UE4 - Outline Material to Highlight Objects when Looked at Them

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ค. 2022
  • Tutorial on how to create an Outline effect when looking at an Object
    This video is an answer to comments from GorudenPanda and JuggernautX as well a great thing to learn!
    A thousand thanks to video from UnrealCG that made it possible to make my own tutorial for the Epic Community!
    Link to his video: • Selection Outlines Wit...
    Knowledge covered:
    -How to make an Outline Effect
    -Materials and Material Instances
    -Overlaps and Overlap Events
    -Why Component, not a LineTrace?
    -Is Valid node and Validity
    Download: drive.google.com/file/d/1ZxAp...
    Thanks to Infectedfury for the "Strike A Pose" that gives some life into my Character!
    www.unrealengine.com/marketpl...
    Thumbnail Text created using cooltext.com
    Credits for the amazing music used in this video:
    -Patrick Patrikios
    -Telecasted
    -NEFFEX
    -Mini Vandals
    -DivKid
    -French Fuse
    -TrackTribe
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 88

  • @xmlstudios
    @xmlstudios 2 ปีที่แล้ว +7

    instead of using a cylinder overlap event you can use a sphere trace as its cheaper and you only get the actor thats nearest to the center of the sphere trace and set the actor of what is its hitting

  • @DenisZaharenko
    @DenisZaharenko 2 ปีที่แล้ว

    Pretty smart technique. I actually wanted the whole texture to just be brighter but this is useful too. Thanks.

    • @UnrealSolver
      @UnrealSolver  2 ปีที่แล้ว +1

      Thanks!
      You can also check the other videos about Highlighting - one with LineTrace and Two Materials, the other is with Collision Shape (Spherical Area) and Single Dynamic Material Instance if you need something else ;]

  • @Starblendet
    @Starblendet 11 หลายเดือนก่อน

    You say "Wonderful" just like Zoidberg and I love it! excellent tutorial by the way, subbed!

    • @UnrealSolver
      @UnrealSolver  11 หลายเดือนก่อน +1

      That’s wholesome! ❤️‍🔥 Thank you 🙏🍻

  • @AnthonyLitton-xn8hx
    @AnthonyLitton-xn8hx ปีที่แล้ว

    Thank you! This worked really well for me in UE5. In my case I also had to get the relative transform of the original mesh and apply it to the newly created mesh, but that is easy enough. Do you have any idea how this would work on a rigged, animated character? Is there an easy way to map the animation pose onto the newly created mesh?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      That’s a good question, well, you could duplicate the skeletal mesh and it’s animation etc. and run a loop on all materials to change the Material but it may be expensive 🤔 but still a workaround ;)

  • @AlignmentsProg
    @AlignmentsProg ปีที่แล้ว +7

    For people that are having issues applying the Outline material with UE5:
    - Use the "Overlay Material" option on the Actor (click details and type overlay on the search bar) and apply the material there
    - At the end of the On "Component Begin Overlap" (after the for loop) use the Set Overlay Material node
    That should work fine

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      That’s the spirit! 💪
      Thank you for this as it really helps out those who are struggling on UE5 with that. That’s really awesome ❤️‍🔥

    • @AlignmentsProg
      @AlignmentsProg ปีที่แล้ว

      @@UnrealSolver No, thank you for this great solution! A lot of people out there are using Volumes to achieve this but that doesn't work for me on my project since that is really hard to maintain :)

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      @@AlignmentsProg Thank you for your kind words Bro!
      Still it's not my own idea, as mentioned in the Video it's @UnrealCG who made it all possible so huge thanks to him in the first place ^_^

  • @eve_hub
    @eve_hub ปีที่แล้ว +1

    how did you get the item overlapped actor 4:33 ?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      Select the Component you want to check and add an event called “OnBeginOverlap”

  • @AzonE1993
    @AzonE1993 ปีที่แล้ว +1

    Great video! But can you please tell me, can this technique be used on glass objects? Because in my case all glass parts get colored.

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +2

      You would like to add Transparency to your Material that works as the outline and make it partially transparent
      The thing is that it takes the full object so from behind it is totally visible and non-transparent
      Just add a new Scalar Parameter so you can control it and use as Transparency power

    • @AzonE1993
      @AzonE1993 ปีที่แล้ว

      @@UnrealSolver , thanks for answer! With chosen Blend mode and Shading model (like in your video) I can't make outline material partially transparent, because Opacity node is grayed out =(
      UPD: Well, I've fixed it, thanks!

  • @Grimm_Entertainment
    @Grimm_Entertainment 11 หลายเดือนก่อน +2

    I can't get this to work in 5.2
    I changed Overlay Material option on the actor and the mesh is constantly highlighted...
    On the end of component begin overlap i used set overlay material node but nope, nothing is highlighting at all...

    • @UnrealSolver
      @UnrealSolver  10 หลายเดือนก่อน +1

      Hi, I do not use UE5 as for now, please check comment from Mr. @AlignmentsProg :)

    • @Grimm_Entertainment
      @Grimm_Entertainment 10 หลายเดือนก่อน

      @@UnrealSolver I got it to work from his comment thank god haha. Thanks very much for the tutorial

  • @joeyfarish2528
    @joeyfarish2528 ปีที่แล้ว

    Thank you for the tutorial :)
    I'm having trouble getting my material to work though. It seems whenever I change my material to be the outline material I made it doesnt keep the old material and outline covers everything :/ Do you know where I may have messed up?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      Maybe you are also changing Color of the main mesh instead of the created one as additional mesh working as the outline, hard to tell without any blueprint insight but that’s the only thing I can think of
      Hop on to my Discord so I can take a look on that ;)

    • @joeyfarish2528
      @joeyfarish2528 ปีที่แล้ว

      @@UnrealSolver Dude, thx for the super fast reply :) Yes, I'll check your discord right now

  • @AdamBielecki006
    @AdamBielecki006 หลายเดือนก่อน +1

    Any idea why cylinder might not follow camera?

    • @UnrealSolver
      @UnrealSolver  หลายเดือนก่อน

      Possibly wrong attachment in the components hierarchy, maybe you attached it to the pawn or something else but not camera 🤔

  • @waterrasta1869
    @waterrasta1869 ปีที่แล้ว

    Thanks for tutorial, its been very useful for me. I am a begginer in this, but i was sure that was a way to do with line trace and... after yesterday night and today i found the solution xDD..... Just tre more things and some less... No itemoverlapper, no cast to char for 'highlighted object'.... just a boolean in both cases (Creation and destroy material flows), one BpInterface(Char and item) to call a custom event when do the line trace... this even its just for creation flow that begin with a branch to check the new boolean variable 'HighlightState', for example, and only if false we do de creation flow (since add mesh component), and addig in the end our boolean setting it in true, branch in false kept empty. Creation Flow its done, destruction its always easily xD.
    To other flow we have to do only two things; in character blueprint we promote a variable the pin actor hit from our line trace function, and do the call for function of the interfaceBP with actor hit as target. In item side, we do a event tick to conect with a branch (delay recomended for less Ram Use in largest levels), we check if hit actor its the same of self (item), if false then conect destruction flow (Since is valid from outline mesh), and adding to the end set our highlited boolean to false.
    Its ready... thanks was easy at the end but i try a thousand of ways before xD... Really thanks.

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      Wow, that was an exhaustive message bro ❤️‍🔥
      I’m glad it helped you to move your Project forward! 🔥🔥🔥

  • @creedence999
    @creedence999 11 หลายเดือนก่อน

    YES! YES! LOVE IT

    • @UnrealSolver
      @UnrealSolver  10 หลายเดือนก่อน

      I am happy to hear that!

  • @Cpt.Tripps
    @Cpt.Tripps 2 ปีที่แล้ว +1

    FYI, if you don't want to subtract for a ForLoop operation, use LastIndex instead of Length of your array.
    Why would it have been a mistake to use ForEachLoop instead, though?

    • @UnrealSolver
      @UnrealSolver  2 ปีที่แล้ว

      Dang, you’re totally right about it!
      Although I know there are things like that or f.ex. An array - if I need a random I still use a “get” node and a random integrerem instead of “get random” from array 🤣
      Thanks for correcting, those are bad habits kept since ever 😅

    • @UnrealSolver
      @UnrealSolver  2 ปีที่แล้ว

      And about this being a “mistake” - well, maybe not a mistake as it’s possible to get same results using this kind of loop as well but would need some more code and I wanted to simplify it
      A wrong word selection here, my bad 😅

  • @OptimumCode
    @OptimumCode ปีที่แล้ว

    This solution looks nice for a simple static meshes. What to do if I have a car Actor with let's say 4 wheels, one body part, 2 mirrors etc. and I want to be able to highlight the whole car Actor?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      You can perform a Loop, get the Actor all Components to get an array and apply the logic to all parts (create new same Mesh and set the Material)

  • @IceBurg420
    @IceBurg420 ปีที่แล้ว

    My cylinder has no collision unless the player is moving
    I have no idea why this is happening, do you have any ideas?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      Well, that’s weird, without screenshots may be hard, shouldn’t happen by default and only think I can imagine is that you have some piece of code making it happen
      Check the About section of my Profile - you will find link to my Discord where I can take a look on it

    • @IceBurg420
      @IceBurg420 ปีที่แล้ว

      @@UnrealSolver alr, sounds good
      I have a very simplified version btw, it just renders in custom depth when overlapped

  • @audixable8096
    @audixable8096 ปีที่แล้ว

    Is there a way to disable highlighting through walls?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +2

      A good approach would be using Tags - add some tag f.ex. “Highlight”
      Then on the BeginOverlap - use a node “has Tags” to check wether given BP/Object has this Tag and if yes - perform the code
      But this video got some questions I will probably make a separate video for this and also using Traces or some different (better than this weird component approach) System anyway 😁

  • @e.Mihaii
    @e.Mihaii ปีที่แล้ว

    I have a static mesh actor component , and when I over lap over it for some reason dosent register the action. My work around was to add a normal static mesh and for it every thing work. Dose anyone have a clue why with a static mesh actor component dosent work?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      Are you sure the Mesh itself has Collisions (simple collision) AND in the Blueprint Editor the Component has “overlap/hit events” turned on?
      Make sure the mesh has a collision and enable the overlap option and try again ;)

    • @e.Mihaii
      @e.Mihaii ปีที่แล้ว

      @@UnrealSolver You are right I dont generate overLap events for my mesh component. Thank for your help ! And I have another question : How can I make my Box Collison ignore the cylinder ? Because when my cylinder overLap with a Box Collison the game consider that my character overLap.

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      @@e.Mihaii either check on Google for “collision channels” to add custom channels to specify what can overlap and what will get ignored or even blocked by collisions
      Otherwise - use a branch on the Overlap Event, pull out from “other component”, find “not equal”, connect with your Component you wanna ignore and put your code on TRUE - that will check:
      IF overlapped component IS NOT Cylinder -> run the code

    • @e.Mihaii
      @e.Mihaii ปีที่แล้ว

      @@UnrealSolver Thank you , the second method work and now I will try the first one , I think its more optimized

  • @tomaszsojka9780
    @tomaszsojka9780 2 ปีที่แล้ว

    I tried it on UE5 and it's not working, any idea what could be different ?

    • @tomaszsojka9780
      @tomaszsojka9780 2 ปีที่แล้ว

      nvm, it was just not visible on the rock asset

    • @UnrealSolver
      @UnrealSolver  2 ปีที่แล้ว +1

      @@tomaszsojka9780 Polecam discorda, znajdziesz w „about” mojego profilu ;]
      Tam jestem w stanie szybciej odpowiadać 👌

  • @shakaama
    @shakaama ปีที่แล้ว

    background song?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      There are a few ;]
      All of them are available on TH-cam Music Library
      Will let you know later which songs I used in this video

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      Music used in the Video:
      - Oh My - Patrick Patrikios
      - Press Fuse - French Fuse
      - Straight Fuse - French Fuse
      - Rich in the 80s - DivKid
      - Smokey's Lounge - TrackTribe
      - Something You Could Never Own - NEFFEX
      - Down With Your Getup - Mini Vandals

  • @plopyy
    @plopyy ปีที่แล้ว

    Why For each loop is mistake ?? I think For each loop is better than length + substract + for loop.
    And you can easily make that with line trace °.° !

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      Yeah, I answered that once in a comment that it was a poor choice of words, my bad 😅
      About the line trace I don’t wanna go deep within comments but wasn’t able to get it to work, can you share any example on blueprintue.com? ;)
      I was pretty convinced it is possible, for some reason my reference was triggering the event to destroy the Actor but wasn’t doing the “destroy” Event at all

  • @deereel1814
    @deereel1814 ปีที่แล้ว

    It works as expected in UE5. The reason why the rock is not highlighted is due to lack of simple collision.

    • @Horizonik
      @Horizonik ปีที่แล้ว +1

      Doesn't work for me

  • @slackamacgaming6721
    @slackamacgaming6721 3 หลายเดือนก่อน

    I just used the texture...the rest is hard to follow and is way over complicated for something so simple...just add 2nd static mesh to your BP component list (same mesh as the first)...put the outline material on it...uncheck visible...use a sphere collision on overlap to set it's visibility...end overlap just set it not visible again...K.I.S.S

  • @Goggalor1990
    @Goggalor1990 ปีที่แล้ว +2

    Doesn't work in UE5. Meshes are colored and lit on the inside, not just the outside as shown here.

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      The very first word of the Title says “UE4”

    • @Goggalor1990
      @Goggalor1990 ปีที่แล้ว +1

      @@UnrealSolver yeah, but people are going to use these tutorials in more than just the short span of time after uploading. Meaning newer engine versions, which most other content creators actually plan for as well as update their viewers on. Can see why you're viewership is so small by comparison, they're actually helpful. Good luck though 👍

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      @@Goggalor1990 for now I don’t use UE5 for various reasons and this is my own choice, maybe one day I will make a video about it
      I have a daily job and private life, this is my hobby and my viewership - I am very happy with it and hope to grow bigger but that will take time as I don’t upload stuff so often

    • @Goggalor1990
      @Goggalor1990 ปีที่แล้ว

      @@UnrealSolver thank you! I didn't expect an answer, I just wanted to make sure anyone that was going to try it in UE5 knew it wouldn't work 😅 I've seen people mention that in other videos comments section to save people time and I just thought I'd do it here as I followed the video and found out the hard way haha. It's a nice effect though and maybe I'll get it working in 5 for my current project. trying to mess around with the 1-x node to see if I can place the outline on just the outside. It kind of works on some meshes so maybe if I increase or decrease some values it might work?

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      @@Goggalor1990 I will take a look and let you know what should be different in the setup 👌

  • @adam4designss
    @adam4designss ปีที่แล้ว

    HOW I CREATE CLOUM OR CHART CHANGE BY DATA OUT SOURCE

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      Mate, chill out, no need for caps lock
      What do you mean because I don’t get what do you mean? It would be good to point it out on my discord ;]

    • @adam4designss
      @adam4designss ปีที่แล้ว

      @@UnrealSolver How can I create a data column and change its height by changing the value of the data while adding the material as in the exercise here. Or add a c-sharp file that contains data in the form of a chart

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      @@adam4designss you mean widget based data column that you can rescale by changing the data inside of it? Or you wanna rescale the thing you look at and have some data in a widget so you can control it?
      Sorry but I still am not sure what your point is 😅

    • @adam4designss
      @adam4designss ปีที่แล้ว

      @@UnrealSolver yes
      howi do it

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว

      @@adam4designss I asked a double question - A or B and you answer “yes”
      Sorry but I cannot help when I cannot understand what your point is
      Saying “both is gud” would be telling much more than the “yes” that doesn’t tell anything at all

  • @MegaSuperCritic
    @MegaSuperCritic 11 หลายเดือนก่อน +3

    Yikes, why all the editing? Can you not just narrate what you do in real time? Appreciate the tutorial, but you cut out so much it makes it very difficult if not impossible for a beginner to follow along.

    • @UnrealSolver
      @UnrealSolver  10 หลายเดือนก่อน +1

      Yeah, when I watch some of my videos later than just after editing I know what you mean. Although possible to follow for newcomers it may be hard.
      Still learning as a Video Tutorials Creator, hope to get better over time
      Appreciate your feedback and will see what can be done to have even better experience!

  • @SJohnM81
    @SJohnM81 2 ปีที่แล้ว +1

    You speak and move too fast to be usefull.

    • @UnrealSolver
      @UnrealSolver  2 ปีที่แล้ว +2

      Sorry for not being useful
      I do my best spending 5-10h to make a video like that instead of meeting my friends or family or enjoying my time in any other way✌️ also provide the Projects ready to download using Google Drive for which I pay in order to have enough capacity for such stuff
      And I did it mostly as answer to requests so I additionally had to learn more about it first before doing a video and those guys are happy now, and it seemed to be enough to make possible what the video offers
      It may look difficult if you’re very new to the Engine and don’t understand what’s really happening, sometimes it may be that you need some other knowledge in order to be able to follow without overthinking
      I try to make not too much splits but instead I speed up parts of the video and explain in the meantime - it’s normal that you may have to pause the video sometimes to follow with the code creation
      But thanks for advice, will try my best to make it better 👌

    • @Cpt.Tripps
      @Cpt.Tripps 2 ปีที่แล้ว +5

      @@UnrealSolver Don't let it get to you, your narration is perfectly understandable.
      Plus there's a Pause button and Playback Speed settings in the TH-cam player for anyone who can't keep up.

    • @xnick99
      @xnick99 ปีที่แล้ว +2

      @@UnrealSolver This guy is wrong. Your speed is fine.

    • @xnick99
      @xnick99 ปีที่แล้ว

      By default, TH-cam lets you lower the speed of a video to .75x, .5x, and even .25x. Try that if someone is speaking too fast

    • @UnrealSolver
      @UnrealSolver  ปีที่แล้ว +1

      @@xnick99 thank you mate! ❤️‍🔥❤️‍🔥❤️‍🔥