Using blueprints to get a material to glow when viewed

Hi,

First off I think it’s worth noting I know very little about Blueprints. I’m an artist by trade so the whole code thing makes my brain freeze. But I’m trying to dable a little and use blueprints to do what I’m guessing shouldn’t be massively complicated.

I need to have a material glow brigter when you shine a torch at it. The idea is you can only see this material when you shine your torch towards it. I’ve been looking at a few tutorials about line tracing and I’m guessing this is the best route to take but I have no idea how to achieve this exact effect.

It would be great if someone could point me to a tutorial that covers this or if they have time to lay out a blueprint that demonstrates how to do this that would be great.

Thanks in advance,

Peter

Is this torch being pointed at anything ( static meshes ), or blueprints?

when you say “shine a torch at it” are we talking “fire on a stick” torch or a modern “flashlight” torch (thanks British English for not differentiating)

line tracing is done based on “knowing” up front the StartPoint and EndPoint in 3D space most times you will be doing so to check against known end points (you may still be doing this but as one of the final steps not the initial)
a “Sphere Trace” on the other hand all you need is an origin and a radius and you can get everything of parameter within that radius (“sphere Trace Multi by ____”)
Though where this is to live in blueprints instead of running a trace (or multiple with regards to line traces) every frame then a collider might serve you better, and you can more generally “fake” line of sight if need be (there is no conical or frustum collider by default)

for the “Fire on a stick” torch

  • sphere trace multi for objects (channel might work too depending on what you are looking for) from the Torch with max radius for the “light to reach”
  • whatever is returned you would do a line trace to it to see if it is not occluded.
  • then you would end up getting the distance, and use that to modify the what will probably be a Material Property I think specular to make it shiny, or emission to make it ‘brighter’

for the “Flashlight” torch

  • starts the same way, but you could add an arcCosine check on the line trace to see if it is within the cone of light (frustum gets a little more complicated especially if it is not to be tide to an actual camera)

for tutorials:
“Unreal Engine blueprint Target Lock” will get you to the point of like radius checks, and grabbing the things (a couple I have seen go as far as the line of sight checks)
“Unreal Engine modifying material properties in blueprints” should get you to exposing the material property, and how to edit it at runtime.

So sorry for the delay in replying, I thought I’d set alerts but never got one.

In regards to the torch, it’s a flash light torch, I never actually realised the US didn’t use that. I wondered why when I was looking for a 3D mesh it only came up with the flame type.

Thanks for the info, I’ll have a go at the target lock.

Many thanks,

Peter

I just had some simple flat polys with an alpha texture on. The idea is it’s meant to be a type of slime that glows when something is shone on it. The torch is a flashlight torch.