Widget animation and blueprint actor problem

After squeezing my brain for the whole day, it’s finally time to ask those here who know way more than me.
I have a widget blueprint that has 6 elements. 5 of them have an animation for render opacity that goes from 0 to 1 and back to 0 at different times. That one I want to loop. Then I made another animation for the remaining element, which is a background. That also has a render opacity animation, from 0 to 1. This one I want to leave at 1.

The first problem I have is that the second animation just doesn’t work. Instead of fading in progressively over the time I set it to, it’s like it’s at 0, then when it reaches the keyframe that has the 1 value, it suddenly appears. It’s as if the two keyframes were together, but they’re not. In fact, they were about half a second apart, and to test this, I set them 5 seconds apart. And I triple checked both keyframes, and there’s nothing weird. In fact, if I play the animation in the widget timeline, it works as it should. But when it shows in the level, it waits 5 seconds and it suddenly appears.

The other animation doesn’t have this problem. When it plays in the level, it plays as it should. I even disconnected the play animation node that has the 5 elements and connected the event construct directly to the play animation node that has the background element, and it’s still appears suddenly. I don’t know if this is important, but the widget is inside a blueprint actor, which in turn is in the level.

So that’s one problem. The other one is that I need these two animations to play when the crosshair hovers over a frame on the wall. That frame is the blueprint actor I mentioned, and if the player hovers over that frame with the crosshair and clicks the left button, that triggers an action. This is done with a line trace and a bunch of other nodes. But I want an overlay to show automatically when the player hovers over that frame, which would be the two animations that I described above.

The problem I have here is that the animations start automatically when I hit play to start the preview. They don’t wait until the player is close to the frame that should trigger that action. Well, actually this happens only if I set the Event Construct node to the play animation node, with a sequence node between the two so I can also trigger the other animation:

But, if I put the event construct before the line trace, then the blueprint actor shows as the two animations already at the end, so it doesn’t animate anything:

These nodes are all in the graph section of the widget blueprint. I tried cutting the whole thing and pasting it in the level blueprint, the player controller blueprint and even the blueprint actor that is the frame on the wall. But the animation nodes are only available in the widget blueprint. If I try to call them from other blueprints, they don’t show up in the list of items I can call with a variable. The widget blueprint itself does, but the animations, not at all. So that leaves me with just the widget blueprint as the only place to put the nodes. But the line trace doesn’t seem to work at all in it.

Any suggestions?

1 Like

OK so I made some progress, with a caveat. At least now I can make it do what I wanted. But the logic of how that happens is lost on me:

I mean, the two animations should be triggered when I link branch to sequence from the True output, not the False. The condition is that the actor has tag “picframe”, which it does. So the logic should be, if the actor hit by the line trace has the tag “picframe”, it’s true, so linking the True output of the branch to the sequence node should execute the two animations.

But if I do that, I see the most weird behavior: when I go into the preview, the frame on the wall has all the items of one of the animations fully visible, when I’m not hitting it with the line trace. When I walk to it, and come into range, then everything disappears except the original picture in the frame. When walk backwards out of range, then it starts playing the animations and it keeps playing them.

So the only way to make this work the way I need it is to link the False pin out of the branch node into the sequence one. Doesn’t make any sense to me. However, if that worked perfectly, I wouldn’t care. But no, when I press Escape, the message log shows me 1365 of these:

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_BreakHitResult_HitActor”. Blueprint: Read_More_Press Function: Execute Ubergraph Read More Press Graph: EventGraph Node: Branch

I read that one way to prevent the “accessed none” errors is to put an “Is valid” node. So I added that:

But I’m still getting the message:

Blueprint Runtime Error: “Accessed None trying to read property CallFunc_BreakHitResult_HitActor”. Blueprint: Read_More_Press Function: Execute Ubergraph Read More Press Graph: EventGraph Node: Branch

Can somebody please tell me what am I doing wrong, and what’s the logic in the node system where I have to put False in both the “Is valid” and branch nodes to do what it’s supposed to do? It seems like reverse logic to me, but I’m sure it’s because I’m still very new at this.

Hi,
I can at least help you with your last picture. Using “is valid” macro is a good idea, but you plug it wrong.
The branch should be pluged to the “is valid” output of the macro, not the “is not valid” one because here you are asking to do something with the actor if it is not valid, hence the error message. “If the actor is not valid, does it have the tag?” is what you have actually.

Then I couldn’t explain why you have to use the false pin on the branch if the actor actually has the correct tag. Maybe using prints could help you to understand which actor is really hit.

Right, but you’re using normal logic. That was the thing I was talking about, that Unreal seems to use some kind of reverse logic, because I’ve seen this before in other thing I did. The only way to get the result I’m looking for (that the animations get activated when the player goes into range) is to put both Is valid and Branch to false. If I put either of them of both of them to True (the way it should be logically), it does everything but what I need it to do.

And, to make matters worse, I just learned that when I build this to HTML5, the frame on the wall doesn’t show at all. It’s completely white, and when I get close to it, nothing happens. Whoch is another thing that is completely different in the editor and Mac and Windows packages than it is in HTML5.

So I’m just so frustrated right now…

Hm, I don’t think Unreal can use magic tricks or send a leprechaun in your computer. I also used to think that when encountered similar issues, but I have always found that it was my fault :sweat_smile:
Maybe you are not hiting the actor you think you are hiting or something like that. Debugging the logic would really help you, but maybe you have already done.
I hope somebody else can help you

Hahaha yeah, I’m sure it’s something I’m not catching because Unreal is really difficult software and I’ve been learning for just 2 or 3 months, and not in a methodical way, but rather googling articles and videos that are about the problem I’m trying to solve at the moment. That’s not to say I don’t want to learn in a methodical way, I definitely will because I love the software, but you know how it is with work and deadlines you have to meet.