sarram
(Cube)
November 24, 2020, 5:48pm
1
Hi.
The goal is to set Static Mesh Collision Preset as “Complex as Simple”
UStaticMesh* StaticMeshAsset;
StaticMeshAsset->BodySetup->CollisionTraceFlag = ECollisionTraceFlag::CTF_UseComplexAsSimple;
StaticMeshAsset->BroadcastNavCollisionChange();
It changes Collision Preset value. But not a Collision.
What am I missing?
1 Like
TheJamsh
(Jambax)
November 25, 2020, 9:04am
2
You can’t change it on the asset - you would have to change the flag on the static mesh component instance that is in the world, however many of them there are that use that mesh. Assets can’t be modified at runtime.
sarram
(Cube)
November 25, 2020, 1:28pm
3
Thanks for the reply, TheJamsh.
I was looking, how to modify assets in the editor, not at runtime. Sorry, didn’t write that in the first post.
However, for me it worked, when I added
StaticMeshAsset->Build();
It worked, but I don’t know if I can use it.
2 Likes
you could use the project settings, Default Shape Complexity
In UE5 you need:
StaticMeshAsset->GetBodySetup()->CollisionTraceFlag = ECollisionTraceFlag::CTF_UseComplexAsSimple;
...
2 Likes