Endless runner spawning in invisible obstacles?

Hey all,

Basically my master tile uses a spawn function. It spawns based off 3 arrow positions, one for each lane. I have all of this working already.

It’s very simple in that it has a probability of spawning an obstacle, and when I hit this obstacle of course my character dies. The issue I am having is, and I know it’s happening because I have print strings involved: The obstacles are being spawned in invisibly and killing my player. He will be running on a blank lane and die with the print string after the death function is called, after collision with said obstacle.

When I go into my only spawning function and change it so it’s just powerups/pickups, I don’t die. As soon as I spawn an object in for ONE lane, and I of course stay away from said lane, I will die and get the print string at totally random intervals. I am guesing the weighted function is carrying over to the invisible spawn - what I don’t get is why there are multiple and invisible versions spawning.

Can anyone help? Thanks!

  • Can you show the blueprint that spawn?
  • also show the actor blueprint that is being spawned.
  • if they have a collision: you can set hiddenInGame to false and it should be visible during play. Have you tried this?

Ok so bp that spawns (middle lane):

For this example I set it as an electricity obstacle that moves back and forth. Again, even if I clear it, it will kill me further down (and not even be there). For death to happen, I have to touch the cube.

Here is the actor BP:

The death function literally just disables input/plays anim/brings up game over.

As for the collission, I have checked the settings right but the issue is that they are all okay, in fact I’m going to upload a quick video of the problem to show it:

Here is the death function in it’s entirety:

1 Like

Don’t think this is your issue, but you are generating a different random float per Branch node (in case this wasn’t intentional):

Can’t really say anything else from this other than your obstacle might be spawning under the track.

Try this: Add a print node that warns you when an obstacle spawns. Press F8 and pause the game. Look for it in the outliner and see where it spawned. It might have been moved under the track by something that was spawned or was there before spawning.

Another issue might be with the obstable itself and collisions with other actors on the lane, like the coins, but I would try the above first.

Hey sorry I meant to say original obstacle spawns in visible and then additional ones invisibly but I will look at both of those thank you

So I tried the it spawning in under or around the track but nothing, what do you mean by this part? “Another issue might be with the obstable itself and collisions with other actors on the lane, like the coins, but I would try the above first.”

I meant it might not be spawning where you want it to or its being moved by something.

Are they spawning where you want them to spawn?

Yeah, the issue is I pass it (or don’t even get to it) and shortly after I die, with the print string saying I hit it, but it’s not in viewer/world

For anyone reading this for the solution:

I checked everything that calls it and was still nothing, and then I FINALLY clocked it and fixed it. Basically my player had a net (a collision box that deleted any actors on contact) behind them called “deleter”. When I unplugged the nodes for the testing, I was dying because I would pass the obstacle fine, but then the NET that was so big it covered everything behind me would touch the obstacle after I passed it and because it was unplugged? It was killing me. I deleted the net and it works fine now. Drove me insane but feel wonderful knowing I at least fixed it.