So first I’ll need to describe what I’m trying to get to happen.
I have a spawner object that spawns cubes in intervals that travel downward. If the cubes hit the floor then the floor gets destroyed, along with the cube, and I need to also turn off the spawner so more cubes aren’t spawned.
So what I need help with is how to reference the particular spawner that’s ABOVE the floor(there will be multiple floor and spawner objects). If I can do that when either the cube collides with the floor, they can turn the spawner off. Or, before the floor is destroyed, it can tell the spawner to turn itself off.
The cube spawns inside of the spawner and travels downward, so I thought that using an end overlap with the spawner could pass a reference to itself there. But that doesn’t work, it doesn’t even print the hello. Yes I’ve checked that generate overlap is checked.
I was also thinking that I could reference it in the floor, but I would need a way to maybe… scan for objects on the Z axis to find out which spawner belongs to which floor. I’m not sure how to do that.
If anyone is willing to offer me any advice or possible solution I’d be very grateful.
Hello,
If you create an array with all your spawners and add an integer variable set with the value of the index where is registered the spawner in the array.
If the spawned refers to the same spawner, Add this variable in spawned too when you spawn it and on event check this value with your array, you’ll have your spawner.
If spawned can lateraly move, do the same with floor instead of spawned.
You can set array in level before play and variables in both spawner and spawned, but as writing i realise that if your spawner is always the one which spawns the spawned, you don’t need it, just create a variable “spawner blueprint” and set it with the spawner directly on spawn.