Item spawns in level but is instantly destroyed

Hi, I’m trying to make a game where you rush to collect more “money” than the other player. my issue is that while I can click and drag the item’s blueprint into the map and make the player pick it up, I can’t make it randomly spawn for some reason, and when I follow any tutorial I’ve found online, apparently the item is destroyed instantly upon being loaded… That and I’m trying to get the items to jump to different locations once collected, but I suspect the previous issue is sort of making the next issue…

Attached is the level blueprint

well first off, the reset is most likely not gonna work.
The event destroyed looks like its the event for the map since you’re in the map blueprint? Is that intended or you hoping for the “money” actor destroyed? in which case that wont work.

I don’t know why its being destroyed immediately… you can check your “lifespan” of the rupee actor and make sure its 0. You can also drag the blue right side connector on the spawn actor node out and SET lifespan to 10 to test if its stays for 10 seconds and then disappears… etc.

oh, also put a short delay between event begin play and the spawn actor… just to ensure its fully loaded before spawning actors… shouldnt matter… but just for testing for now til you get to the root of it.

he does say its spawns but is instantly destroyed, so the spawn function isnt failing.

This is the exact thing I was going to say check the life span. Good luck.

Check Window->Development Tools->Output Log, if spawn function fails it always print reason in log

When I add the “lifespan” function to the “return value” pin I get the following error:

Error Blueprint Runtime Error: Attempted to access rupee_collect_C_15 via property CallFunc_FinishSpawningActor_ReturnValue, but rupee_collect_C_15 is pending kill from function: 'ExecuteUbergraph_TopDownExampleMap' from node: Set Life Span in graph: EventGraph in object: TopDownExampleMap

I have the lifespan set to 10, I also checked all other objects, everything’s initial lifespan is set to 0.0

I’m not sure why the spawn function isn’t looping, but it’s not failing, and the log also doesn’t show anything interesting either really…
(I’d paste the log, but it’s too long)

to simplify it.

drag the begin play to a delay… add 10 sec.
then delay directly to one of the spawn nodes. skip the reset and loop etc.

just try to spawn a single one after 10 sec delay… see if that works

Ok, I just tried it, what happens is it plays the event graph, but doesn’t show anything in game, still no idea why though, nothing’s below the world/map either

Here’s the graph for the “coin”

Show the view port of the rupee… click on the mesh and show the collision options on the right.

Perhaps it’s spawning just fine and its dropping through the floor and into China. The chinese are then collecting them and buying nice things with it.

This works just fine for me. In fact to prove that theory… do exactly what I have pasted in the image below. If you see the fire spawn, then your collision settings on the actor or the mesh itself need to be looked at.

for some reason the viewport doesn’t want to show the rupee until I change something on it (like add or take away a collision then it comes back, bug in udk? ) I also got the same error value I got before when I put in the lifespan at the end…

“Error: Error Blueprint Runtime Error: Attempted to access blue_rupee_C_34977 via property CallFunc_FinishSpawningActor_ReturnValue, but blue_rupee_C_34977 is pending kill from function: ‘ExecuteUbergraph_TopDownExampleMap’ from node: Set Life Span in graph: EventGraph in object: TopDownExampleMap”

try spawning something else, like fire first in my example… see if that at least works for you. Go back to the rupee after.

ok, so I just did the same thing but instead of using either of the rupees, I used a cube and a cone with basic collision markers and no graphs on the “items”, they both spawn randomly but neither of them destroy, but that’s because I haven’t put in a “destroy on collision/touch” node on the items… yet…

I highly suspected the random spawn system was working properly, but this doesn’t explain why the items are just destroying instantly instead of when they’re touched by the/a pawn player…

Below is what is on the player, but I don’t think that’s doing anything either regarding why the items are being instantly destroyed…

I decided to try and put a delay just before the only “destroy actor” node I have in the whole file, and while it does the delay of the item being destroyed, it still doesn’t explain why it’s being destroyed without the pawn touching it when it’s being randomly spawned… I’m really confused…

in the event overlap where it says other actor before the destroy

drag that out and choose CastTo and choose your player parent blueprint.
From the cast to drag out the blue line and choose isvalid.

Then on the isvalid node drag out isvalid to the delay
isnot valid does nothing.

looks like your rupee is destroying after overlapping anything… like the floor, other rupees… anything.

look at the first part of this img… see how the overalp is looking for a player actor and not just any actor… you want something similar to that. As in you want the rupee to respond when a PLAYER hits it, but nothing else.

Ok, so now they’re showing up randomly, but the item doesn’t destroy when I touch it, it just plays the sound plus the point system isn’t working anymore?

post what your rupee bp looks like now.
the point system… no idea. depends on how you’re tallying that… probably in the playerbp? focus on one problem at a time

SWEET, it destroys now! thanks so much for that, that was quite frustrating! (I’m sure it was for you as well haha, sorry about that)

Should I open a new question for it to get the point system to work? and for another for the rupee to appear in a different area on destroy?