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"

Code randomly working (problem with cast or binding)

I have a problem since this morning with the game I'm currently developing, and I don't remember having done anything in particular that might have caused it. This problem is a little blurry even for me, and I don't know if it is a bug within the Blueprint System or an error that I created. The code that isn't working is supposed to get information from a widget in the level and modify it, so it uses casting and bindings. What's weird about this whole thing is that it doesn't seem to have anything to do with my actual code, because it works randomly.

For example, sometimes it works in the editor window but when I try to launch it as a standalone game this part of the code doesn't work. One try after (without modifying anything) it doesn't work in the editor window, and the same things happen when I launch the game in the viewport. Note that it works randomly with the editor window and the viewport but never as a standalone game.

alt text Here (viewport) I placed 4 units on the grid and the progress bar at the top right corner shows that I have 4 out of 20 units placed.

But if I now launch the game in a new editor window, the progress bar is no longer working. alt text And it is the same if I launch the game in the viewport again.

alt text Here is the code that is supposed to increment the variable in the widget to update the progress bar.

It only works again if I modify the code but only a certain way (i haven't figured it out yet but it seems that it works again only if I change code or default values of variables that have something to do with the casting of the widget inside my blueprint). Note that I don't have to actually modify what the code does, only replacing a function by the nodes it contained or printing a variable from the casted widget for example.

This problem is also going on with other functionalities that I implemented a long time ago (unlike this progress bar) and that are working only when the bar does, so I don't know what to do and it makes the development of my game nearly impossible.

If you have any idea please share it with me, it would help me a lot. Don't hesitate if you want more screenshots or details about the problem.

Product Version: UE 4.20
Tags:
working1.png (799.2 kB)
not-working2.png (753.9 kB)
code2.png (112.0 kB)
more ▼

asked Apr 14 '19 at 07:39 PM in Using UE4

avatar image

yoyo1254
1

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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