Enable embedded collisions
Activate an existing collisions in a mesh
Summary
Published: January 20, 2024 by Akiway Last documented update: January 25, 2024 by Akiway
This guide shows you how to enable an object's embedded collision for entities without (items that you can walk through).
It's a direct follow-up to Adding Objects to the World.
Wait, this is not what I want!
If you want to create AMM: Custom Props for AMM, check the corresponding guide. Note that this mechanism applies for them as well!
Requirements
Object Spawner 1.5 (screenshots say 1.4, but it's the mod title that wasn't updated in 1.5 😄)
You know how to Archived: Merging World Additions via ArchiveXL
allmeshes.archive and updated allpaths file created by KeanuWheeze - this will help us to edit new ent files with embedded collisions.
You need a Wolvenkit Project
Find an eligible object
Not every object contains an embedded collision, so we first need to check if your desired mesh has one.
Once in-game, search for the item you want to spawn; I'll be using
base\meshes\base_environment_decoration_furniture_industrial_industrial_table_industrial_table_g.ent

In the
Spawned
menu, click onCopy Path to clipboard
to get the current.ent
path.

Back in WolvenKit, create or open your project
Open the Asset Browser, turn on the Mod Browser option, paste the path and add the ent to your project.

After you added it, turn off the Mod Browser option; otherwise, you won't be able to get the mesh file in the next step.
Open the .ent file and look for the mesh component in its components array.
If the selected entity is from allmeshes (starts with
base\meshes\
), then there is probably only 1 entPhysicalMeshComponent called custom_meshIf not, it means your entity is from the vanilla game; in this case, search for the component that has Mesh in its type (entPhysicalMeshComponent, entMeshComponent, etc...)
In the mesh, click on the blue arrow to open the mesh in a new tab (we don't need to add the file)

Decisive moment: Open parameters and look for a meshMeshParamPhysics

Have you found it ? Amazing ! It means the mesh has a native collision that we can toggle on. 👍 Let's do this now.
Activate mesh collisions
Turning it on is pretty simple; we only have 2 things to change, all in the .ent file previously added:
Update the
filterData
and change the values like in the screenshot. Those values determine which entities can collide with, and how to simulate the collision.

Change the
navigationImpact
setting toBlocking
. (Other values exist; they haven't been documented, but you may have fun with them.)

Optional: depending on the item, you may want to enable (or not) lighting-based shadows. You can do so by setting these 3 properties to
Always
.

In our test case, I renamed the file as mod\embedded_collision_test\decoration\industrial_table_g.ent
.
If the path of your ent changed, don't forget to add it to the allPaths.txt file used by Object Spawner.
That's it! All you have to do now is to install your mod and launch the game.
Once in-game, open and load the new entity with the new path and verify that collision is enabled. 🎉

Last updated
Was this helpful?