---
description: Activate an existing collisions in a mesh
---

# Enable embedded collisions

## Summary

**Published: January 20, 2024 by** [Akiway](https://app.gitbook.com/u/2021vbDrMKZ0TbHeIx2wzPyAYtl2 "mention")\
**Last documented update: January 25, 2024 by** [Akiway](https://app.gitbook.com/u/2021vbDrMKZ0TbHeIx2wzPyAYtl2 "mention")

This guide shows you how to enable an object's **embedded collision** for entities without (items that you can walk through).&#x20;

It's a direct follow-up to [**Adding Objects to the World**](adding-objects-to-the-world).

{% hint style="info" %}
As of today (Jan 20 2024), you need a collision-enabled mesh for this. We can create our own collisions with the [wolvenkit-blender-io-suite](../../modding-tools/wolvenkit-blender-io-suite "mention"), but the tutorial for this isn't ready yet.
{% endhint %}

### Wait, this is not what I want!

* If you want to create [custom-props](../everything-else/custom-props "mention") for AMM, check the corresponding guide. Note that this mechanism applies for them as well!

## Requirements

* [**Wolvenkit 8.12.0+**](https://github.com/WolvenKit/WolvenKit)
* [**Object Spawner 1.5**](https://www.nexusmods.com/cyberpunk2077/mods/2833) _(screenshots say 1.4, but it's the mod title that wasn't updated in 1.5_ :smile:_)_
* You know how to [add objects to the world using Object Spawner](adding-objects-to-the-world)
* [allmeshes.archive](https://mega.nz/file/eRREwQbY#L7AWM1eYijyvE7GLo6IK4MQE2ohJci9r9xcq5gk8BXQ) and updated [allpaths ](https://mega.nz/file/WEQxySrS#0QM1rbl1QaUuRdU3RcNEVvYk-rfk_mVVDyg75y8XG40)file created by KeanuWheeze - this will help us to edit new ent files with embedded collisions.
* You need a [Wolvenkit Project](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/usage/wolvenkit-projects)

## Find an eligible object

Not every object contains an embedded collision, so we first need to check if your desired mesh has one.&#x20;

* 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`

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FRBibSN46s5uq9knE6vfD%2Fworld_editing__embedded_collision__select.png?alt=media&#x26;token=998baf0e-aed2-4be8-af4a-eb60fbf3c913" alt=""><figcaption></figcaption></figure>

* In the `Spawned` menu, click on `Copy Path to clipboard` to get the current `.ent` path.

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FGqamRupyFp3IIZWuHl0T%2Fworld_editing__embedded_collision__copy_path.png?alt=media&#x26;token=2a32c1fa-e380-4982-871b-914276c53905" alt=""><figcaption></figcaption></figure>

* Back in WolvenKit, create or open [your project](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/usage/wolvenkit-projects)
* Open the [_Asset Browser_](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/editor/asset-browser), turn on the [_Mod Browser_](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/editor/asset-browser#mod-browser) option, paste the path and add the ent to your project.

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FM9YAPr9nDAQtpx31vfga%2Fworld_editing__embedded_collision__mod_browser.png?alt=media&#x26;token=9470f553-c238-44b9-869d-163b6fd7053b" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
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.
{% endhint %}

* Open the [.ent file](../../../files-and-what-they-do/entity-.ent-files#mesh-component-entity-simple-entity) 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 <mark style="color:orange;">entPhysicalMeshComponent</mark> called _custom\_mesh_
  * If not, it means your entity is from the vanilla game; in this case, search for the component that has Mesh in its type (<mark style="color:orange;">entPhysicalMeshComponent</mark>, <mark style="color:orange;">entMeshComponent</mark>, 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_)

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2F6MFOZnIyUpEqJrhmjWi8%2Fworld_editing__embedded_collision__open_mesh.png?alt=media&#x26;token=1fccc595-a4e5-4472-9e6d-0b9b08aab530" alt=""><figcaption></figcaption></figure>

* Decisive moment: Open parameters and look for a <mark style="color:orange;">meshMeshParamPhysics</mark>

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2F8p70x1WND6BPWqoOQLiE%2Fworld_editing__embedded_collision__mesh_physics.png?alt=media&#x26;token=5789e270-6bdb-4407-bdb2-92caa3e02e44" alt=""><figcaption></figcaption></figure>

Have you found it ? Amazing ! It means the mesh has a native collision that we can toggle on. :thumbsup: [Let's do this now.](#activate-the-mesh-collision)

{% hint style="info" %}
**What if there is no&#x20;**<mark style="color:orange;">**meshMeshParamPhysics**</mark>**&#x20;parameter in the mesh ?**

It means that there is no collision with it. But other solutions exist for you:

* You can create your own collision through Blender (no modding ressource is available at this time)
* You can fake the collision by using another small entity which already has collision embedded, and hide the small entity inside your item (this technique is a work-around, that does not always fit or give satisfaction, but most of the time it does the job)
* You can try to find another similar item that has embedded collisions (and go back to the first step of this page)
{% endhint %}

## 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.&#x20;

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FIlJLio0UdRTk4xEYJTQx%2Fworld_editing__embedded_collision__filter_data.png?alt=media&#x26;token=e50f613e-8702-4b89-ad67-15e5e7bf6646" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This information is not well-researched as of Jan 2024 - if you know anything more about this, please get in touch via [Discord](http://discord.gg/redmodding) or update the wiki!
{% endhint %}

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

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FPCdsmb7W9IOxBhr5iY21%2Fworld_editing__embedded_collision__navigation_impact.png?alt=media&#x26;token=a46c1f34-2798-44aa-a151-6612589ad7b6" alt=""><figcaption></figcaption></figure>

* **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`.&#x20;

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FYa0M4uWJWzFAH3Dm03ZT%2Fworld_editing__embedded_collision__shadows.png?alt=media&#x26;token=126dd743-ba85-407d-bd0c-5c2f9136eddb" alt=""><figcaption></figcaption></figure>

<details>

<summary>Lighting-based shadows comparison</summary>

Here is the difference between the values `Always` and `Never`

<img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2F8v8Ub4ac1DTuu7S5Wx5C%2Fworld_editing__embedded_collision__shadows_comparison.png?alt=media&#x26;token=b6dbfda6-b8c7-4daa-8445-62eb1e7624f0" alt="" data-size="original">

**Note:** As you can see, `Never` values will prevent the mesh from casting shadows in the surrounding environment, but your mesh will still handle local shadows cast on itself.

</details>

{% hint style="info" %}
I strongly suggest you to change the .ent name and folder to [a custom one](../everything-else/moving-and-renaming-in-existing-projects), so it doesn't interfere with the rest of the game.
{% endhint %}

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](https://app.gitbook.com/s/-MP_ozZVx2gRZUPXkd4r/wolvenkit-app/menu/toolbar#install-and-launch).&#x20;

Once in-game, open and load the new entity with the new path and verify that collision is enabled. :tada:

<figure><img src="https://1427525421-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gzcGtLrr90pVjAWVdTc%2Fuploads%2FIpURobcdrmMiKOHbNjnB%2Fworld_editing__embedded_collision__result.png?alt=media&#x26;token=eab14237-2266-46ee-b8d8-7c84932c692d" alt=""><figcaption></figcaption></figure>
