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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Collect items to end game

Hello,

I'm currently working on a small game for class where you play as a dog and you have to find all eight tennis balls lying around the level before time runs out, or else the game ends.

The only thing I'm having trouble figuring out is making it so that whenever the dog moves over a tennis ball and it vanishes (I already got that part down by putting a destroy actor node), it's added to it's collection and when you walk over eight in total, you get a "You win" screen.

Any help is appreciated, thank you.

Product Version: Not Selected
Tags:
more ▼

asked Dec 02 '16 at 07:27 AM in Blueprint Scripting

avatar image

tmvilla
7 3 3 3

avatar image tmvilla Dec 02 '16 at 11:41 PM

alt text

I just realized I forgot to add the Add to Viewport node, I'm a moron...

Anyway, now that I walk over a ball, the "Win" widget shows, but it only does it when I pick up one tennis ball, which is not what I want, I want it to show when I get all eight. I've been trying to figure it out, but nothing is working.

Any help is appreciated thank you.

blueprint2.png (86.4 kB)
avatar image Rrrramadge Dec 03 '16 at 12:31 AM

I attached an image to your previous comment that should help with that.

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

3 answers: sort voted first

There are different ways to handle it but this is how i would most likely set it up. I put the variable and Win event in the Dog BP and do the rest in the Ball BP on overlap with a collision Sphere, Hopefully that Helps. alt text

dogball.jpg (680.3 kB)
more ▼

answered Dec 03 '16 at 01:17 AM

avatar image

Rrrramadge
256 11 4 7

avatar image tmvilla Dec 03 '16 at 02:31 AM

Ah I'm sorry about that, for some reason my comment didn't go through right away when I submitted it..

But anyway, I tried this and it seems to work perfectly! Thank you so much!!

avatar image Rrrramadge Dec 03 '16 at 02:34 AM

No stress, Happy i could help

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

There are several different ways to do this, I did something similar in opening a door for a school project where I counted down how many keys were left in the level to open a door, to start I made the key (pickup) check for an overlap of anyone tagged friendly which is my player, then I casted to the game mode where I made a function which set my number of keys picked up by +1, then in the door I did a branch comparing how many keys are needed for that door to be open, from a do once node I then fired the function that this door served which was opening the door, for you that would fire off the end game sequence, however youve either done that or are planning on doing that. The end goal is different but the logic between the two projects is so similar you would just have to slightly change a few easy values to match your goal. Should not that the function is in the game mode because I needed its value to be seperate from the door and the key objects. ,alt text

itempickupcount.jpg (537.9 kB)
more ▼

answered Dec 03 '16 at 01:32 AM

avatar image

RyanD2233
15 2 3 6

avatar image Subzeroblack May 23 '18 at 01:09 AM

This looks like what I need which is a similar scenario as OP. But quick question, is the top left blueprints put on key/keys blueprint. If so, why does (Actor has tag) say "key"... do you have the player with the tag "key" on it?.............Second, the bottom left is written within the Function "Total Keys Picked Up" located in the Active GameMode, or is it in the Event Graph?...........Sorry im still new to UE4 and just wanting to double check....For example I put a (Play Sound 2D ) after the Keys (Branch), but the sound doesnt play, but if I put it after the (Begin Overlap) it seems to play the sound correctly. So somewhere between its not working.

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

I would create a variable (interger) in your dog blueprint and then when you pick up a ball cast to the dog put in a branch if it's less than what you need add one once you reach your desired number call your end game event, hopefully that makes sense

more ▼

answered Dec 02 '16 at 07:40 AM

avatar image

Rrrramadge
256 11 4 7

avatar image tmvilla Dec 02 '16 at 08:10 PM

alt text

This is what I've got in my blueprint for my character (the dog) and nothing seems to be happening when I move over the collectible.

blueprint.png (64.6 kB)
(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