Download

HELP how to trace against geometry collection collisions?

so chaos is king and trees are his first crusade.
ill explain my thinking, trees are a staple for most environments and can be a major component in selling a scene. if not tree then concrete pillar .

one of my friends recently said of gtaonline “the cars can boost, jump, shoot missiles even fly but the trees will always win” and it is rather emersion breaking when a tank explodes from hitting a tree.

so if i want ALL trees to be chaos destructible and i mean 10000 particles(if that’s what the chunks are now called?) per 0.5m tall, i’ll will need to do some actor or component swapping.
great so ill set my projectile to wake/swap trees on impact with a check on if we care about impacts on this tree or likely will soon. ok so make geometry collection in to a blueprint actor and get actors location fine. can i hide behind the tree no it has no collisions for trace ok but the projectile will hit so…

problem
there are no collisions so the projectile just passes through. ok where do i set the collisions, oh thats right physx doesn’t collide with geometry collections.

solution
rebuild engine with bCustomSceneQueryStructure = true; added to the UE4Editor.Target.cs and use a trace to hit
thanks to OptimistickMonkey for pointing out the need for that alteration

ill re-edit this with a complete guide once i figure out the rest

any other tips on geometry collection collisions please comment as i couldn’t find any that go into more depth

In order to use linetraces with chaos you must build the engine with:

bCustomSceneQueryStructure = true;

you sir are an idea saver
could not find that anywhere

I have this set and my traces never hit geometry collections (4.23). Additionally, any time I try to affect a geometry collection with a strain field or physics field or the like, I have to do it at the start origin of the geometry collection, it will not work if the geometry collection has moved or if a piece has rolled away from the origin.