Download

Make a player character stop glowing after they have started

Hi!

I want to make the player character produce a point light when they enter a collision box and then stop producing the point light effect once they leave the collision box.

I’ve managed to make the character start to glow (with the point light effect) but I can’t get it to stop (in fact when the character re-enters the collision box another point light is applied).

Below is my blueprint (and link to it).

Any ideas?

Thanks in advance!

Edit:
SOLVED

What’s happening here is you are applying the same exact logic for when the player enters the collision box as when they leave the collision box. It would be better to add a point light component through the components panel (as opposed to adding the point light with a function), and just modify the visibility with your overlap events.

Ok, so if I instead add the point light in the Level Blueprint (as seen in the image/link below) and don’t make it Visible, what do I need to add on my BoxTrigger Blueprint to make it toggle said point light? I’ve been sitting here for around 2,5h now and I can’t figure it out and no guides are helping. I’m new to UE and blueprints so it’s problably something super easy I’m missing.
Imgur

Drag light component to BP
drag off light component and set visbility

Thanks for the reply, but could you please clarify? I am as I said new, so obvious stuff might fly over my head.

Where do I do what?

@suplextrain

That’s what OptimisticMonkey means:

https://vid.me/sMCP

Just change the visibility checkboxes to your liking. If you want to have the point light disabled at the start, then just go into the point light properties and uncheck “Visibility”.

The cube is just for demonstration purposes and is not important for your functionality.

Not quite. What we’re talking about is adding the point light component to the character, and then casting from the collision actor to the character actor to toggle the light visibility.

FYI I was just interested in giving him help in terms of adding the point light component, because he seemed to be utterly lost, how to add a point light to a character. The same logic applies, just with an additional cast to the player character and the light being on the player character. He also didn’t specify, which template he uses or what his blueprint character actually is called. That’s why I left it out.

suplextrain: Use ausernottaken’s solution. The “Cast To FirstPersonCharacter” is actually a cast to a predefined template character, specifically of the FPS template. You need to search “Cast to” and then search for your character blueprint/character blueprint’s name.

Thanks for the help so far guys, it’s greatly appriciated!

I think I almost got it, the only part I’m unsure of how to get is the middle part between Cast ToThirdPersonCharacter and Set Visibility (see image 1). Yeah sorry, forgot to mention that I’m working from a Third Person template.

But to break it down. So I need to have the Event BeginPlay, Add Light Component (with visibility off) and Get Player Character set under the Level Blueprint? (see image 2)

Then in the Trigger Actor Blueprint (that should only have a TriggerBox, not a point light added under components?) (see image 1) I should add what ausernottaken’s image show and add the missing [Target PointLight] and it should make the Third Person character glow (trigger the point light) when they enter the BoxTrigger and make the point light not visible when the Third Person character leaves the BoxTrigger area?

Image 1

Image 2

I think you are thinking way too complex about this problem :). First thing I would change is that the point light is not added to the character through your level blueprint. Add it instead in the ThirdPersonCharacter blueprint with the event BeginPlay, because you will also cast to the ThirdPersonCharacter. This is how I would go about it. You can change and modify it, how you want it :).

https://vid.me/abuF

Yay! I finally got it to work the way I wanted it to. Thanks DarkGodsLair, ausernottaken and OptimisticMonkey :smiley:

I’ll edit the first post with the solution so if anyone else runs into the same problem and finds this thread they can easily see the solution.

Thanks again all!