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"

How can I break a loop once a player leaves the volume of a certain area?

Hi! I'm relatively new to Blueprint (or game making in general xD) and I think I'm starting to get the hang of it. However, I'm being troubled by a few problems. The first one that I'm trying to fix is looping.

I'm using the Rolling Ball template, and inside it there's a variable that turns on (CanJump) and it enables the player to jump. By default it's enabled when the player hits something. What I'm trying to do is make it so that when the player steps into a certain area (A physics volume) the player can jump an unlimited number of times (it loops every 2 seconds).

Now, all that works. The issue that I'm facing is that I would like to break the loop as soon as the player leaves the volume.

Here's what I did:

http://i.imgur.com/aCOXDOk.png

It's most likely something trivial that I overlooked, but please help me solve this issue. What I tried doing was making a custom variable with a Boolean that turned on whenever the player steps into the physics volume, and I made the WhileLoop use that as the condition. Whenever I try playing it crashes, so I'm a bit confused.

Thank you for your time!

Product Version: Not Selected
Tags:
more ▼

asked May 01 '14 at 04:12 AM in Blueprint Scripting

avatar image

jfaztk
326 45 62 72

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

3 answers: sort voted first

Oh. Could you explain why?

more ▼

answered May 01 '14 at 10:49 AM

avatar image

jfaztk
326 45 62 72

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

The WhileLoop is executing itself into an infinite loop?

You can put the Completed into your Set node and it will be fine, but the loop body is probably what is getting you.

more ▼

answered May 01 '14 at 10:14 AM

avatar image

Zeustiak
1.8k 130 68 110

avatar image jfaztk May 01 '14 at 10:54 AM

Thank you for the reply. Unfortunately, it still crashes.

http://i.imgur.com/2xblx8m.png

Is that what you meant?

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

Hello,

"EndOverlap "Event for that physics volume will help you :)

try to break the loop when "EndOverlap" fires

more ▼

answered May 01 '14 at 11:23 AM

avatar image

HoOz
357 24 29 46

avatar image jfaztk May 01 '14 at 07:47 PM

Hey, thanks for the reply. Unfortunately, it still doesn't work. It doesn't crash anymore, but if I exit the volume I can still keep jumping.

http://i.imgur.com/GGD5pn2.png

Is that what you meant? I looked at the flow of the nodes and I noticed that when it overlaps and it sends the signal to break the loop keeps going.

avatar image Nidal Nov 22 '14 at 02:10 AM

Were you able to figure this out ?

avatar image jfaztk Nov 22 '14 at 02:10 AM

Yeah, I believe so.

avatar image Nidal Nov 22 '14 at 02:14 AM

What did you do? Can you post the solution?

avatar image jfaztk Nov 22 '14 at 05:47 AM

Sorry, I worked this out a while ago, and I got a new computer/project while I was at it. I honestly don't remember what I did :(

avatar image Nidal Nov 22 '14 at 05:49 AM

That's fine. :-)

(comments are locked)
10|2000 characters needed characters left
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