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"

Infinite while loop despite A>B condition?

We made these platforms in class today that break after the time displayed above them. I wanted to take it a bit further and see if I can make that text act like a countdown once you step on a platform, decreasing in 0.1 values every 0.1 second. This is the blueprint that I have so far but I keep getting an infinite loop error and I don't understand why. It's supposed to decrease the value of DelayDestruction (an exposed parameter of these platforms) by 0.1 after waiting 0.1 second, write the data to a TextRender component and repeat this process as long as DelayDestruction is > than 0. Please help me out if you can see where I made a mistake, Thanks!!!alt text

alt text

Product Version: UE 4.9
Tags:
platforms.jpg (47.4 kB)
more ▼

asked Feb 12 '16 at 06:17 PM in Blueprint Scripting

avatar image

ant1fact
8 2 4 5

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

4 answers: sort voted first

Hi ant1fact. Try thatalt text

001.jpg (166.3 kB)
more ▼

answered Feb 12 '16 at 06:35 PM

avatar image

Anatoliy
323 12 8 20

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

Hi ant1fact. Thank you for stripped version. I look it and found some strange. If you switch position of delay from start loop all works fine. But why cant say, its looks like bug.alt text

002.jpg (113.5 kB)
more ▼

answered Feb 13 '16 at 11:08 AM

avatar image

Anatoliy
323 12 8 20

avatar image Anatoliy Feb 13 '16 at 11:17 AM

Sorry, that way will more correct :)alt text

003.jpg (91.9 kB)
avatar image ant1fact Feb 13 '16 at 01:35 PM

You're awesome, I never would have figured that out. It's strange because logically no matter where I place the delay in the loop body it's supposed to give the same results.

I don't want to bother you too much because you already helped a ton but what is happening right now is that the number drops immediately from 10, 20, 30 etc to -0. Is there a way to make the countdown happen? Like 10 / 9.9 / 9.8 / 9.7? I thought the Delay node was doing that.

Anyway thanks so much again!! At least I can continue tinkering with it without having to worry about infinite loops:)

avatar image Anatoliy Feb 13 '16 at 02:32 PM

Hi ant1fact. alt textI think that's a result you need :) Just replace folders from ziplink text

fracture_test.zip (489.9 kB)
004.jpg (85.0 kB)
avatar image ant1fact Feb 13 '16 at 05:00 PM

Sorry I was cooking lunch and just got back to this:D now it does just what I wanted. I will study this blueprint carefully to understand how you achieved this this result. Thank you soo so much, bless you my friend

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

I see that you resolved it, but I wanted to add : to my knowledge, delay nodes don't "pause" the execution. The while continues to loop every frame but stops at the delay since it is still cooling down. When the cool-down of the delay is finished, the remainder of the execution path is executed.

My guess would be that whatever method is used to detect infinite loops picked up that the while was executed many times without the condition changing and wrongfully interpreted that as an infinite loop.

Sorry if you already knew this :P

While Anatoliy's method seems to work well, you could also simply use a Timer by Event and make a custom event "Update Time". You set it to looping every 0.1 sec. In the event you decrease the time, display it and test if it's more than 0. If not, you stop the timer using the timer handle and make the platform fall.

more ▼

answered Feb 13 '16 at 06:59 PM

avatar image

Violaine
46 2 1 3

avatar image ant1fact Feb 13 '16 at 08:39 PM

Hi Violaine! Thank you for your input, I will have a look at it that way as well. I'm happy to try out anything because there is so much to learn about UE and blueprints

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

Hi Anatoliy! Thank you for your suggestion. I tried it that way but I am still getting the same error.

You can download a stripped version of the project on this link if you would like to have a look:) The problematic blueprint can be found in the Fracture_test folder. Thanks again!

alt text

alt text

tried.jpg (141.2 kB)
error.jpg (12.3 kB)
more ▼

answered Feb 12 '16 at 07:53 PM

avatar image

ant1fact
8 2 4 5

(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