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…
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.
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
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”
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.