- Issue: UE-75309
- Issue page: https://issues.unrealengine.com/issue/UE-75309
- Version i’m testing with: GitHub release branch (currently 4.22.2-0)
I’ve been trying to figure out what causes this bug, and I think it’s caused by bUseTriangleSampling
/ bUseVertexSampling
not being set properly.
Of note: the game doesn’t have to be fully packaged to trigger the bug, it just needs to be run standalone. Running the game from the editor in standalone mode, or running the DebugGame
configuration from VS with cooked content works fine.
Here’s the current behavior: When a standalone game tries to load an actor with a skeletal mesh, and a niagara system set up to sample that mesh surface, the behavior depends on the Skinning Mode:
-
None
: Doesn’t do anything. Works as expected. -
Skin on the fly
: Game runs, but particles don’t track animated meshes properly. Instead, the particle system will behave as if the skeletal mesh was always on the first frame of its animation. -
Pre skin
: Game crashes as soon as the actor with the mesh and system are loaded.
Look in NiagaraDataInterfaceSkeletalMesh.cpp
at line 515:
ENDISkeletalMesh_SkinningMode SkinningMode =
(GIsEditor || Interface->bUseTriangleSampling || Interface->bUseVertexSampling)
? Interface->SkinningMode
: ENDISkeletalMesh_SkinningMode::None;
If a project with an actor as described above is run in standalone mode, and a breakpoint is set here, you’ll see that Interface->bUseTriangleSampling
and Interface->bUseVertexSampling
are false
even though this skeletal mesh interface should be using skinning. If you replace that line with:
ENDISkeletalMesh_SkinningMode SkinningMode = Interface->SkinningMode;
and ignore the flags on the interface, the standalone game will run without crashing and the system will behave properly. It would appear that bUseTriangleSampling
/bUseVertexSampling
are not being set properly in the UNiagaraDataInterfaceSkeletalMesh
. As for why that’s happening, this is as far as I’ve gotten. I’m not really interesting in taking this further at the moment but hopefully this is helpful.