Respawning Question

Hi,

I am trying to respawn an item after 2 seconds on my level. the item is a BP (apple) which i can pick up (collision box). after destroying it i want it to be respawned at the same spot. i tried this BP but it obviously wont work. i can destroy it but it wont respawn. any sugestiond for a beginner?
Thank You
Randy

Your problem is here

If you destroy the actor, after 2 seconds there’s nothing to run the respawn :slight_smile:

You could try hiding it when you pick it up, and after 2 secs just show it again.

Or: respawn immediately, but make the new apple hidden by default for the first 2 seconds.

Hi Clockwork. Thank you! Thats what i tought. Can you give me an Idea how i Hide/Show? How do i do that?
Is this a good way to do it? Because i do have many Items (wood, apple, stone) etc… and if i could have spawn the randomly, even on other places i would love it. But im a beginner and i have no idea… watched some YT videos but haven’t found exactly what i wanted.

i have a few other things i want to solve and actually i am looking for someone who could show me how to do things (remote access to my computer and show me directly inside my project) im willing to pay something…

1 Like

Just

As for the many items, they are all basically the same thing, right? Just the mesh is different.

So it’s really just one BP, and the mesh can be randomly different when it spawns.

Maybe you can describe the concept you want?

yes thats correct. the mesh is different and the target name (node) the thing is i have set up a datatable / struct for each item (ID, name, description, weight, worth ($$), art of item (food, weapon, tool etc…) but the blueprints are not yet connected. i want this datastruct/table for later use (inventory / crafting) and i also want to save if the object is on the level or in the “inventory” and how many of each.

1 Like

i also want to “eat” an apple, deduct one from the inventory and increase the hunger bar.
later i want to add a simple crafting system which allows me to craft an axe or hammer etc with wood and stone and stuff like this

1 Like

so far i can change the character and hit next. the other buttons are not working yet

1 Like

Ok, so one blueprint is totally possible. When it gets placed in the scene, or spawned, it decides what sort of pickup it is, sets the mesh, and reads the appropriate data table entries. The info data always stays in the table. When you view something in the inventory, the relevant row is just shown to you in a widget.

When you ‘pickup’, it can spawn another copy somewhere else in the level and destroy itself, add itself to the inventory etc.

Using something from the inventory is a separate issue here.

I can help with the mesh / spawning etc. A bit with data tables ( don’t really use them ).

As far as inventory goes, there’s a lot of good stuff in the free section of the market, and many tutorials on youtube.

So I made this simple pickup blueprint

It just has a collision box and a mesh ( as yet unset ). The construction is

The possible meshes array ( which you would probably get from the table )

and the code

So it waits for a little while before showing itself, and then tells the player to pick it up ( with an interface ) on overlap. And then just spawns another instance some distance ways before destroying itself.

That last part can have many forms such as random point in an area, random distance from the player etc…

pickup

Also many ways to pick up, this is overlap, but you can use a line trace and interface call, and so on.