Sphere Overlap Actors not ignoring actor.

Why is this Sphere Overlap Actors not ignoring itself? This is running on an actor when it gets clicked. It returns itself in Out Actors in addition to the other Galaxy Stars actors around it.

Hey @Elryk1!

How are you generating the information confirming that it is returning itself instead of some weird galaxy star thing somewhere else, or even worse an identical copy of itself overlapping it? Could you bring back how you’re generating that?

Also, weird thing but you could try it, make the array and then set the array as a variable, then call that variable for the “Actors to Ignore” input, just to make sure it’s 100% saved and usable before that node finishes.

Let us know how things go! :slight_smile:

I found out it is the same actor because of a weird material artifacting issue. All galaxy stars have a unique name. After you click A galaxy star it saves all the star information and the information of all the stars returned by this section. Then, it loads a different level and uses this information to set the information for the existing actor (sun) with the information of the clicked galaxy star, then spawns in other stars based on the information gathered by this Shere Overlap Actors. It gets the location for these spawns by subtracting the clicked star’s location from the returned actors transform.

I know its still getting this star in the Sphere Overlap Actors because if I tell it not to spawn the star if it has the same name as the star that was clicked (that is now the central sun), the artifacting goes away.

I’ll try making this array sooner (cant do it much sooner though) and see how that goes.

That doesn’t fix it. Even adding a Delay until next tick after setting the array doesn’t help.

Okay! So two things:

Try to truly confirm it by using a printString, and a Find(array) check using the actor vs the list, and if it finds the actor in the array, print “True”.

Names aren’t always the best way to go about it, sometimes you want the specific actor reference. This way you can find out if somewhere else in your code, it’s spawning it from there. You need to confirm that the problem is actually here, in THIS bit of code. I tested it in 5.6, and using self as an actor to ignore is 100% usable.

Basically, what I’m saying is if you’ve tried everything here… let’s find out if the problem is here at all.

The problem here is that you’re getting a false positive. If it’s spawning another actor, from the same class… it would have a different name. We need to see this code to know what you’re doing exactly. But don’t worry! I think we can get this solved very soon! :slight_smile:

Ok, the actor is not found with that test.

The respawning is happening on a different level, with a different actor class. The name I am talking about is a name I have given it, basically a base 36 conversion of its location on the first level. Its just a string variable.

Here is the rest of the code from the on click event of the star in the galaxy map (the first level):

Then when the SolarSystems level is opened, this is run for begin play:

I can’t understand how the clicked star’s Name (the variable) is getting added to the “Solar Stars Name” array if it isn’t being hit by the Sphere Overlap. And its not just the name, all of the information for the clicked star is in the respective arrays.

Also, to be clear, this happens with any star I click from the galaxy level. It’s not just one specific star giving the problem.

Is it possible that you already have overlapping actors? Try moving them around a bit and see if one is underneath- or alternatively, do something like “Sphere Overlap Actors with radius of 1.0”→ Out actors → For each → Set Actor Location and add something like 10 to Z for each index number and see if there is more than one there?

This is definitely something interesting, my brain is saying one thing- Overlapped Actors. Also your game must be at a very small scale- 200 is pulling whole star systems! Wow

The star actors in the galaxy map are generated and placed with PCG. It seems unlikely that every or even most stars are overlapped perfectly. There is no partial overlapping (it would be visible and I don’t see it) and no stars even touch. As I mentioned, this happens with every star I have checked when the branch before the spawn in the solar system is not there.

The galaxy level is small scale, the whole level is just a map. I wanted to keep it small so it loaded as quickly as possible and there is no reason to make it huge anyways (it just shows the stars, no planets or other assets). Its also only has about 1k stars. The solar systems will be much bigger since that’s where almost all the gameplay will be. Even the numbers in the solar system now are just place holders and will probably end up 100x or more of what they are now.

I stand corrected! It seems PCG is making duplicates, even with self pruning. Its not all points, but quite a few are getting duped. I’ve just managed to snag one of the duplicates with every test.

Isn’t self pruning supposed to fix this?

I’m going to be honest, I haven’t used the PCG system whatsoever, it’s just not something I’ve needed for any projects since it came out. I made my own procedural dungeon system but that was the version before PCG… So I haven’t even started learning it. In my opinion it’s very advanced software that’s far too new not to have to clean up a lot of bugs.

That being said the #1 skill I’ve learned to have with UE5 is being able to research :slight_smile: and with that research I found… I think you need a “Bounds Modifier” node to give it bounds for the “Self Pruning” node to use as a reference. Give that a try!