Remove an instance static mesh using line trace

HISM do need the cast

No, they don’t. That’s simply not how things work. You need to cast to get the right type in case you want to do something that the class defines. Casting is super useful for other things but you do not need it to use the Hit Item.

the system will 100% for a fact break
down if I do it without the cast.

No, it won’t. Try it, knock yourself out. If you’re casting for this, you’re just using a very slow and a very inefficient filter. There are better ways.

For instance my level gen using hisms
but if I remove the cast it does
nothing, plug the cast in? Boom
generated level.

Then you’re doing something weird elsewhere. Casting is just a conversion… it does not really do anything magically on its own.

To clarify:

If you get something outside of instance index range, absolutely nothing will happen (have a look at what the BP exposed node does under the hood)

And if you’re hitting something that is not a (H)ISM, you’ll just get an invalid -1, which is actually useful for super quick identification.


Perhaps there some’s confusion regarding what happens to the indexes when HISM culling kicks in:

Some info here about HISM indexing (needs scrolling down a lot):

And here if you want to get into advanced stuff with vertex interpolators where indexing gets funky when combined with LODs:

It’s now fixed in 4.26 for HISMs!

1 Like