[4.10.1] - Blueprint Object Comparison Operators Broken

Hey Guys,

I’m trying to compare an object and I noticed that the Blueprint Object Comparison (==/!=) aren’t returning a correct result. If I do a != and leave the second asset as blank, if it has a object reference, it is saying false or if I compare two of the same kind of asset, its saying false.

Thanks!

Wait, this might be something different. I just used the Blueprint AND operator and two Trues = False ?! I’ll try to look into this further.

So what I am trying to do is compare an object but it is showing a name in its place. My guess is its actually a mixup with the BP debugger and not a direct result of the actual data present. Maybe because an object of the same type (UMG Widget) was just destroyed and re-created to quick for the BP Debugger to think that it was looking at a different object altogether where in fact the operators were working all along. However, if that were the case, it would be coupled with something else that threw everything off and made it function incorrectly based off of invalid data. Weird?

I’ve added a delay of 0.01 and now everything is coming in correctly but I was attempting to detect that. If anyone comes up with anything different, let me know. Thanks!

I tried the != operator on another object and it worked fine so I have no idea what was causing the data to show up that way.

,

I’m a bit confused. Are you still experiencing this error or have you resolved it on your end? If you are still experiencing this error, have you checked to ensure that you are populating the reference before checking against a NULL value? How are you populating it?

Hey ,

I am still experiencing it but I’ve managed to get past it with a delay of 0.01. What is happening is I integrated Respawning into the game. When I first did this, the UI was missing when the character died and would respawn. Because of this, I attempted to re-create an instance of the UI Widget in the HUD and attach it to the Viewport whenever BeginPlay on a Character would happen.

What was happening is I was checking to see if a given UI element had the player registered with it and a valid reference to the player stored to update data coming from an event delegate on the player character. When the Construct method on the UMG widget hit, it was saying, and mind you since I re-created an instance of the UI, this should have been a new widget reference, but it was showing that I had a reference to the dead Pawn and it was pulling the dead pawn reference when calling the “Get Player Controller” node in BP. This was after Destroyed on the dead Pawn being called.

In that Construct sequence, I also have a Branch where I check if the Pawn reference was stored and if its valid. When I do this during respawning the character, it was showing invalid results. For instance, a != on a Character reference variable was showing false but the debugger was showing the old pawn reference still in it.

But the 0.01 delay was enough probably for the engine to recycle the Destroyed Pawn from memory. But that was pretty much what was happening.

BTW, hope all has been well and happy holidays !

Where are you creating your widget? If it is in the player character I can see how this would occur, however it may be worthwhile to look into moving the UI creation/call to either the player controller or the Game Instance. Have you tried either of these to see if you get the same results?

Ha, actually, I just moved it to the Player Character’s BeginPlay to get things working better so you hit the nail on the head. However originally though I will say I had the issue before I moved it there and before it was located in the custom HUD class’ own BeginPlay. But I will definitely take your advice today and move it to either the PlayerController or GameInstance and see if that helps but no I haven’t. Let me also ask you if you don’t mind, is it possible to keep the UI persistent across Respawning a Pawn. I figure it might be if I move it to the PlayerController like you said since the PC is just possessing other Pawns before they are destroyed but let me know if that’s possible. Before, it did keep a single instance still live in the HUD and it was also showing as added to the viewport but wasn’t visible, even with a forced SetVisibility using the slate visibility enum.

Thanks Again !

Okay, so I tested so far moving this to the PlayerController and that unfortunately didn’t work at all. I couldn’t get it to show up after the player was respawned. I even tried to make a custom function to switch the owner of a Widget using a PlayerController (since ULocalPlayer is not Blueprintable) thinkin that could help but nothing ended up working. I still have yet to test out GameInstance atm. I also found this thread where someone mentioned a similar situation (On respawn hud stops working - UI - Unreal Engine Forums) and their solution was also a delay. In their case it was 200ms but I was able to set it to 10ms and that still worked in my case. What’s the preferred way Epic typically sets this up for their games (in regards to handling Respawn + keeping the UI consistent)? If I can avoid anything hacky like delays because of late references I’d rather do that and follow a much more preferred setup but if I need to go this route, it should be fine. However it doesn’t explain why I was seeing invalid data in the BP debugger originally but that’s the least of my worries since it only seemed to be in this one use-case.

Do you have a project or repro steps I can take to try and reproduce this on my end? It would help me to fully understand what you are seeing so I can better assist you.

Hey . Unfortunately I don’t think I’d be able to do that. I will check this out however and try to get back to you shortly. We may need to put this one on hold until after the break. And BTW Merry Christmas to you and the team and thanks for all the help!!!

Happy holidays to you as well, I’ll leave this open over the weekend and into next week, once you have more information, please post it here and I’ll be happy to take a look.

Hey MC ,

We haven’t heard from you in several days. I am marking this as answered for tracking purposes. When you are able, please post here with the updated information and I’ll be happy to take another look.

Hey ! Saw the response in my email. This isn’t my own game through UltraStorm but with another company Dark Rift that I’m working for currently and I did attempt to replicate this in a different project but because the game has grown so much, I think it could be specific our UE4 project. The team at the Rift is going to be off until next week but I’m pretty sure I’m going to link with Nigel, the Creative Director by this weekend and be able to ask him. I’m aware that I think Epic has their own NDA for these kind of things but let me ask you a question.

Ellis chimed in on this on a thread I posted on the forums a couple weeks back but I’ve heard that Epic has a paid option for support. forwarded me off to the licensing webpage but I remember another Epic Staff member a year ago roughly posting a specific email when another community member asked the same thing. But I wasn’t aware if a developer would have to sign up for a full on license or not for the paid support I heard about.

Anyways, thanks again and hope you had a great Christmas!

has it correct. The proper way to move forward would be to apply for our custom licensing option. Unfortunately I don’t have any more details on the licensing options at present.

Gotcha, thanks for letting me know . And please don’t take that inquiry as an offense to how you all get on AnswerHub and work hard to help out the community. You guys are beyond amazing and do a great job with this service in helping out people and have helped me out time and time again for now a couple of years which I greatly appreciate. I just remember hearing some people talking a lot about on the forums that there was a step above and I had a feeling it was the licensing option but some people made it sound like it was a standalone service. I will look into some of what Epics latest offerings are with licensing and at least for Dark Rift, could suit our needs depending how it differs with the standard 5% offering. I’ll definitely check that out!

Regarding some of the funkiness I saw, once I get a chance to speak with some people next week, I’ll see if I can get you a build of the project and I’d at least be able to walk you through the exact point that it happens. I’m not so worried about the BP debugger showing bunk info for that scenario and since the link I posted above mentioned that sometimes you need a slight delay to properly switch Pawns for the HUD to work (in their case) and it seemed to do the trick for me as well, we might be okay just letting this one slide if you’d like. I know 4.11 is right around the corner and I know that even though that build focuses on optimization, there could be a couple additional bug fixes but I do want to help if I can.

I’ll reach out to you next week and let you know either way if we can do that. Take care and Happy New Year!!!

Hey , got a good update for you. With the funkiness I saw earlier, I think there was a bug where the engine was presenting me with data from another instance of that UMG Component. While investigating, I remembered that there was a second instance at the time so I’m just guessing that was the issue.

However after taking your advice and moving the HUD (UMG Widget) creation to a custom PlayerController, that worked perfectly as they are spawned once per level regardless of player death. So I’d say we are all good here. Thanks again for the advice and help. Much appreciated once again and take care !

,

I’m happy to hear this is no longer occurring for you. I am marking this as answered for tracking purposes. If the error appears again, please feel free to post here with updated information and I’ll be happy to take another look.