x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[4.8.1] - Bug w/ Comparing Object Reference Inside UMG UserWidget

Hey Guys,

Got another one I think is a bug. I'm not 100% just in case it has to do with a lack of understanding about something underlying in the engine. What is happening is when this Custom UserWidget is created, it grabs the Owner Pawn Reference, casts it to a custom Pawn class type and stores it to be referenced later.

The UMG Widget I'm creating is a ChatWindow and it calls down into a custom Pawn class in C++ to pass the new chat text off to a custom PlayerState to redistribute to all connected clients.

What is happening from what I can see, is I do a check seeing if the 'Pawn Reference' variable is valid when needing to call any members within. I can see right before the 'IsValid' call is that it is storing a reference to the correct Pawn however when I try to evaluate it with IsValid or doing an != and leaving the second value NULL, it always shows as not a valid reference.

So it's a little confusing but hopefully not too bad to solve. Let me know what you want me to try.

EDIT: BTW, this only happens on a Client and not Server instance. Since UMG only runs on the client, I'm scratching my head on where the reference has gone to.

Thanks Again!

Product Version: UE 4.8
Tags:
more ▼

asked Jul 07 '15 at 01:06 AM in Bug Reports

avatar image

MC Stryker
453 22 37 48

avatar image Rudy Q ♦♦ STAFF Jul 07 '15 at 03:36 PM

Hello MC Stryker,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?

  2. If so, could you provide a detailed set of steps in order to reproduce the issue on our end?

  3. Could you provide a screen shot of any blueprints that may be involved with this issue?

  4. Is the custom pawn that is being used to store the information ever instantiated in the level?

avatar image MC Stryker Jul 07 '15 at 08:51 PM

Hey Rudy and thank you for chiming in on this one!

Absolutely I can try those out. I didn't initially post a screenshot as I needed to get approval from other parties that in this case it's okay or if I would need to email it directly to you but it's not a problem whatsoever.

I'll try to evaluate this shortly for you. Worst comes to worse, you should expect an answer by tomorrow afternoon (PST) at the latest.

Stay tuned and hope you and the team are doing well!

Thanks again!

avatar image MC Stryker Jul 09 '15 at 01:16 AM
  1. I didn't have an opportunity to repro this in a clean project. Today is unfortunately way too slammed but I was able to capture some screenshots for you.

  2. I have a UMG Widget that serves as a ChatWindow. I have an underlying C++ interface and base class (so I can see it in C++ and its functions). In the UMG Event Graph for the ChatWindow, I have the Event (from interface) OnTextCommitted' inherited and overridden from the text box where this happens. At 'BeginPlay' I grab the Widget Pawn Owner from UserWidget, cast it to my custom Pawn and store it in a variable, 'Pawn Reference'. Back in OnTextCommitted once it is called, I check if the reference is valid and if so to call the SubmitChatText function. As a note, the 'Pawn Reference' variable is set to be Replicated. When debugging, Pawn Reference is holding a reference but when evaluating with Is Valid or just seeing if its simply not NULL, its still showing failed and not Valid.

  3. Screenshots below... alt text Link: https://onedrive.live.com/redir?resid=2D24BE74E7380A5D!114836&authkey=!AFPOWR1V-SLgy-I&v=3&ithint=photo%2cjpg

  4. Yes

So it's pretty odd that IsValid still thinks its empty but hopefully you can help me understand what's going on better. Thanks again!

avatar image Rudy Q ♦♦ STAFF Jul 13 '15 at 05:46 PM

Hello MC Stryker,

Could you try and resubmit the screen shots from the post above. There seems to have been some sort of error. Also, I wanted to check in and see if you have had any time available to try and reproduce this issue.

avatar image MC Stryker Jul 13 '15 at 07:02 PM

Absolutely... I noticed this with a post with Eric K the other day. It might be due to changes in OneDrive... hang tight buddy. brb

avatar image MC Stryker Jul 13 '15 at 07:06 PM

Okay Rudy, try now and let me know if you see it. I also went ahead and posted a link to view just in case. Thanks again and hope you are having a great day!!!

avatar image Rudy Q ♦♦ STAFF Jul 14 '15 at 03:52 PM

Hello MC Stryker,

I have a test I would like for you to try. Could you try setting "Pawn Reference" to public and add in a delay for 0.1 seconds just before you set the variable. I believe that this issue occurs due to an issue with the order at which things are taking place. I believe that your "Pawn Reference" variable is getting set before the pawn is spawned in for the client. Using a delay will allow you to rule this out as a possibility.

avatar image MC Stryker Jul 14 '15 at 09:00 PM

Definitely! I'm doing an upgrade to 4.8.2 right now so once that's complete, I'll get that tested out and get right back to you.

Thanks!

avatar image MC Stryker Jul 14 '15 at 09:27 PM

Okay Rudy, got an update for you! I unset it as being private and did what you said but slightly altered it and got two different results.

If I delay w/ 0.1 s, it fails like before...

However, if I set the delay to 0.2, it succeeds!

I can try and remember to do a Delay before storing a Pawn reference but maybe this is enough for you or an engineer to track it down and eliminate it.

Thanks Rudy!

avatar image MC Stryker Jul 14 '15 at 10:41 PM

Hey Rudy,

I've got another update for you.

I just tested this again and it didn't work. I was testing a Dedicated Server running 2 client Windows and was able to fix it by delaying storing the Pawn even longer. In the case I just tried it was 2 seconds but that may be too long.

EDIT: Just tried again w/ .2 and it worked. :|

avatar image Rudy Q ♦♦ STAFF Jul 20 '15 at 01:43 PM

Hello MC Stryker,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello MC Stryker,

Thanks for all of the updates. I am happy that we were able to find workaround for you. I have another way that should be more reliable. In the example that I provided below, I set the pawn reference variable every 0.1 seconds that the pawn reference variable returned an "Is Not Valid". As soon as the logic gets a Valid response it will end the loop. I hope that this helps.

alt text

Make it a great day

isvalidpawnhelp.png (110.4 kB)
more ▼

answered Jul 15 '15 at 06:24 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 524

avatar image MC Stryker Jul 20 '15 at 10:00 PM

Hey Rudy!

I just saw this post and had missed your reply from last week. I'll apply that fix asap and thanks a bunch for getting back to me :)

I'm guessing this isn't by design and will likely change but were you able to determine the original cause? I'm guessing its something as simple as when the order of things fire in the engine underneath the covers.

Does this only affect UMG widgets or should I replicate this across every Blueprint that needs to gather and store a reference going forward in the future?

Thanks Rudy and hope you had a great weekend! Take Care.

avatar image Rudy Q ♦♦ STAFF Jul 21 '15 at 01:47 PM

Hello MC Stryker,

This is a current limitation. The order that objects are instantiated cannot always be guaranteed between machines. It's good practice to have contingency plans in place for this potential occurrence. I hope that this information helps.

Make it a great day

avatar image MC Stryker Jul 21 '15 at 07:52 PM

It absolutely did Rudy and thank you very much :D

Thanks again for your assistance on the issue and I'll keep this in mind in the future if I encounter similar problems.

You and the team have a great rest of the week!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question