Is it possible to get a reference to specific HISMC?

For context, I’m trying to create semi-realistic planet ring system 1000’s km in size and can’t fill the entire thing with asteroids.

I’ve managed to get the Ring BP to add HISMC asteroids within a bubble around the player as they travel through it, capped it at a few 1000 for performance.

I’ve figured out the (if over vector length or earliest integer) bit… but then how do I get a reference to that specific one to remove it ?


FHitResult member “Item”…

HitItem in bp

HISM has a few Get Instance functions, for example getting instances overlapping sphere. Here’s an example how I’ve used it:
And here’s a video of how it worked:

It was jut a simple example I’ve made to show someone how to do it, but if you actually want to do it efficiently, you may want to cache the reference for the component in a variable so you don’t have to cast every time.

Still can’t seem to get at what I want, I feel like line trace got me further and I have tried overlapping sphere too…

I can’t figure out how to measure how far the trace was, see if it was over a certain amount and isolate that specific instances mesh represented by the trace result for removal.

I want to remove all instances outside of an overlapping sphere I guess.

How do I filter Hit result Items by distance?

I tried checking the hit location / Vect length / >= / Branch / Remove instance… but it seems to remove all of them.

So the result of a physics query ( like a linetrace) will return a HitResult for each shape it hits. The HISM maintains a shape for each instance. So you will get a HitResult for each instance, with the instance identified by HitItem.

With that said, what exactly are you trying to do?

The HISM already partitions the instances for culling . It automatically creates clusters of instances and culls and LODs them.
That is the difference between HISM and regular ISM.

eg if you are in the center of the asteroid field facing north, any clusters that are entirely behind will be culled.

You can validate this using one of the stat tools (cant remember which command)

Thanks for the reply, I’m about 6 weeks into unreal so I’m pretty fresh,

My HISM doesn’t cull for whatever reason, it’s in a pretty gigantic blueprint, the scale is many 000’s big, this may be why.

I’m just trying to destroy asteroids that are too far away to matter, my toughest problem yet. I attached the section (sorry it looks like a dogs diner)

The general goal is to have a generated, almost infinite asteroid field around the player, only when I’m near the ring.

Cheers OM,

Yeah - testing and removing instances on tick via line tracing might not be the best thing performance wise. BTW - the LineTrace node above is not needed at all in that screenshot - you can just calc the distance directly from instance and ship locations. But you dont want to check every ship every frame anyway.

How do you know the HISM isnt culling?
A fun way to verify culling is to use ~FreezeRendering, then use ~ToggleDebugCamera to eject and fly around the map. You can see what isnt being rendered this way.

Be sure to check the culling properties on the hism component. By default they are set to not cull.

As a simple alternative, you could also just partition your map into multiple ism components. These should cull when entirely outside view frustum.

I find this tool very useful for working with instances:

And this video is informative:

Oh the line trace delete was great! the behaviour has changed a lot but Branch still seems to get stuck on open, removing all instances tested…
getting somewhere though!

You are right! Asteroids don’t render when not looked at, but they do ignore the distance culling when camera facing.

Even with cull distance set at 2 units, once created they are visible from the other side of the planet 2188047.75 units away as the odd miss-rendered pixel!

Flying through the field and turning back on yourself just looks like the ship leaves cookie crumbs for miles behind :smiley: Could do with getting rid of them really

Looks like il have to rethink this, partitioning may be a good place to start! Thanks for the help OM!