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"

What's the best way to respawn a pickup in blueprint?

I've got my pickups working well in blueprints, however I'm unsure about the best way to spawn them. I've been trying to make a class that spawns pickups at the start of the game and when they've been collected a wait time occurs before they next spawn again. (sort of like an MMO's spawn time).

I was thinking that it would be like respawning a player, but I remembered players require pawns and playercontrollers. Has anyone achieved respawning pickups?

PS: This is for a local splitscreen multiplayer game.

Product Version: Not Selected
more ▼

asked Sep 12 '14 at 08:53 PM in Blueprint Scripting

avatar image

173 37 33 43

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

4 answers: sort voted first

Hi Kagamusha,

I just so happen to be working on this for a personal project and it's actually pretty similar to veggiesaurus' idea. Here is how I am doing it:

I have a Spawner class that I built with a Sphere component (PickupCheck) and a Scene component (Spawn Point):

alt text

Then I hooked it up like so:

alt text

The "IsBatterySpawned" bool is default True. Essentially I am spawning in the pickup blueprint, then when the player overlaps the area it would will do a check to see if the pickup is no longer there (My pickups will not destroy if you have full ammo/battery, so players could come back later). After that, it just does a simple delay and respawn. Let me know if you have any questions.



pickupspawner3.jpg (182.9 kB)
pickupspawner2.jpg (151.8 kB)
more ▼

answered Sep 12 '14 at 10:59 PM

avatar image MaroonersRockAnimation Jan 05 '16 at 12:54 AM

I tried replicating this exactly how it is and it spawns initially, but never re-spawns again. Can anyone see what I am doing wrong here??

alt text

alt text

avatar image MaroonersRockAnimation Jan 05 '16 at 01:24 AM

I forgot to set the collisions. Fixed. Thanks for looking!

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

I've recently implemented a system that does exactly what you want, I think.

I have a pickupSpawner blueprint class that has two variables: respawnTime (float) and pickupClass ( class [not instance] that inherits from my Pickup blueprint class. On beginplay, the pickup spawner spawns an actor of the pickupClass type. When the pickup is collected by the player, it triggers a custom event in the pickupSpawner that spawned it, which lets the spawned know that the pickup has been collected. The pickupSpawner then respawns the pickup after a delay specified by the respawnTime parameter.

One other addition that I've also implemented is a counter, which checks to see if the pickupSpawner has "stock" of the pickup before spawning. Each time the pickup is spawned, the counter is decremented, and once the counter reaches zero, spawning is prohibited

more ▼

answered Sep 12 '14 at 09:08 PM

avatar image

529 20 21 61

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

Depending how you item class is designed. If you got pick up and inventory item seperate you can do what Sand write, if single class is used for pickup and inventory, you can spawn new item in place of pick up and hide component (by some call on pickup) until specific time pass.

more ▼

answered Sep 12 '14 at 09:14 PM

avatar image

35.7k 925 168 1101

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

What i would do if i was you: When the player collects de item i put a "DO ONCE", hid the pickup mesh and do what the pickup do to player when is collected....then put a delay to respawn....after this show the hidden mesh and reset de DO ONCE....

more ▼

answered Sep 12 '14 at 09:04 PM

avatar image

371 55 49 64

avatar image MaroonersRockAnimation Jan 06 '16 at 06:06 AM

Here is a BP I did with a random item variable and timer function so different items will appear at the specified time variable. Hope it's Helpful!

![alt text][1]

avatar image oneforall Mar 28 '19 at 02:38 PM

Here is how i did it alt text

respawnlogic02.png (395.8 kB)
respawnlogic01.png (201.7 kB)
(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