Widget Animation Repeating Issue

I made a crosshair that shows up with a fade animation every time i face at a door but when you face at the door for the first time and you face it again the animation repeats.

Blueprint on BP_FirstPersonCharacter:


(The Targets are connected to a Create Widget node on BeginPlay)
(The Line Trace Node is connected to EventTick)

Blueprint on WG_Crosshair:
Capture002

Instead of having the fade in on construct, you could make it a separate function and call it just like you call the reverse fade. That might fix it maybe.

You could also print string test that the game knows the door is there. Maybe its ability find the door is the thing that is “flickering.”

I tried to do the event construct thing before and it was the same.

And for the Print String thing i put one when it fades in and other when it fades out and both get printed every time it flickers so yea, it’s a door finding issue but i dont know how to fix it.

Okay, now at least we know it isn’t the widget.

If your game is having trouble finding the door with a line trace, maybe you need to edit the door a bit. Is it just a static mesh right now? If you make it an actor to give it a collision box and make the box go outward a bit maybe the trace could find it easier?

The door it’s an actor blueprint. I tried to change the trace responses in the model but nothing changes. Maybe it’s a blueprint issue, that would explain why it works fine for the first time.

I don’t know why now i’ve got this error, the crosshair doesnt show up and the facing to door true print string is spamming every time i face at the door:


Edit: Now randomly i don’t get this error and the crosshair shows up again (The repeating issue it’s still there) but i didn’t changed nothing. Maybe it only happens when i open the project and stop happening like two minutes later.

That looks like you just need an Is Valid node somewhere.

i tried to put one at the start of the nodes before but nothing changes

Since it thinks something isn’t valid for the “add to viewport” function, that suggests that it is the widget variable. So, either put IsValid in front of wherever you are getting your widget variable or turn your widget gets into validated gets.

Though, that would have nothing to do with the line trace stuttering. But, one problem at a time.

well i tried to put an is valid node before the add to viewport branch and nothing changes but how do i turn widget gets into validated gets?

Wait. So, the widget variable is getting through the IsValid node right in front of the “add to viewport” node and still spamming “accessed none” about the “add to viewport” node? Or is it just spamming accessed none about some other node?

You can make validated gets by right clicking on a getter and selecting to convert to validated get at the bottom.

it’s still spamming, basically nothing is changing, i tried putting it before the true or false branch before the add to viewport and play animation nodes and i tried put it before the line trace node too. here it’s what i did now:

I know it is probably fine, but I have to ask. The variable you are using IsValid on is the same one you are plugging into the “add to viewport” node right? You just have a different copy of the same exact variable above the pic cutoff?

And when it spams “accessed none” it is indeed still spamming it specifically about the “add to viewport” node? And there are no other “add to viewport” nodes in your graph?

This is just really weird for it to validate a variable and then say it isn’t valid immediately after is all.

@Detach789 Hey! Have you got an answer?

Sorry, I don’t have enough free time to browse the forums as much as I was before.
I have no idea why it isn’t working unfortunately.

oh well no problem :slight_smile:

Maybe this will help.
In the Widget animation panel-> right click on the track-> properties->When Finished-> Keep State.
This will make the animation play till end state and stay there.