# Project-Wide Surface Settings

In order to add surface-specific properties that affect the vehicle behavior, open the Package Settings window.

Open the window by going to Tools -> CustomVehicleController -> Package Settings.

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FWyJOmezuxN3TISL69XTH%2Fimage.png?alt=media&#x26;token=adb6da5d-08be-4e32-b950-dc641fd12a68" alt="" width="349"><figcaption></figcaption></figure></div>

You will see a foldout where you can:

1. Enable/Disable this feature
2. Associate the physic material and the surface properties

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2Fl9jkXzQbP6QkloFOxNcj%2Fimage.png?alt=media&#x26;token=5b5ba7a7-b67f-4f6f-926e-298c39717990" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Disabling the project-wide surface settings means that when the wheels will ask for properties depending on the physic material that they hit with raycast, they will get the default surface with&#x20;

1. 0 Surface Roughness
2. 1 Acceleration Friction
3. 1 Steering Friction
4. 0 Surface Drag
   {% endhint %}

### Surface Properties Explained:

1. Surface Roughness - defines how bumpy the surface is. This is purely for a shaking visual effect, which can be enabled on the [CarVisualsEssentials component.](https://distubredone322.gitbook.io/custom-vehicle-controller/additional-settings/car-visuals-essentials#car-shake-effect) Acts as a shaking effect strength multiplier.
2. Acceleration Friction - a multiplier to the car's acceleration friction.
3. Steering Friction - a multiplier to the car's steering friction.
4. Surface Drag - additional drag to the car's rigidbody. The actual amount that will be added to the rigidbody is scaled with the amount of wheels on this surface, so for the full effect all the wheels must be in contact, otherwise the effect will be lessened.

{% hint style="info" %}
Acceleration and Steering Friction parameters affect only the wheels that are actually in contact with this surface.
{% endhint %}

### Managing the Surface Settings

1. To add the new surface setting, click the "New Surface Property" Button.

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2Fm8FfVQkqkqnM3QKa8jCU%2Fimage.png?alt=media&#x26;token=3aa8e8d3-abae-467d-8d07-4d2dd454b2d3" alt="" width="157"><figcaption></figcaption></figure></div>

2. To remove the setting, click on the "X" button on the right of the setting.

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2F35ekGCwAKSr2LdaFMdFY%2Fimage.png?alt=media&#x26;token=daf537bc-0d99-481d-8209-171ccb9a66ac" alt="" width="139"><figcaption></figcaption></figure></div>

3. After you create a new entry to the surfaces list, assign a physic material.

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FdWcO4SZBVvrjfar9x0WH%2Fimage.png?alt=media&#x26;token=39b4d06f-3409-4f35-be4d-3179f656daf8" alt="" width="563"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FZvpid3TiwjLJL7sO2v0p%2Fimage.png?alt=media&#x26;token=cd288e80-a4a1-4388-a318-5f947ddb5f41" alt="" width="563"><figcaption></figcaption></figure></div>

4. Modify the parameters

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FgMtC2jjNB7XzgnGFsbjC%2Fimage.png?alt=media&#x26;token=77a456f3-07e8-4cf4-b736-6ccf19266254" alt="" width="563"><figcaption></figcaption></figure></div>

5. Assign the physic material to the road's collider component

<div align="left"><figure><img src="https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FNSe7svwWBJxUbTgBFT43%2Fimage.png?alt=media&#x26;token=1aca2b69-888c-4dad-8359-a1bd3a6825ce" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The actual values on the Physic Material have no effect on the vehicle's behavior. However, they still affect how the car responds to the collisions, therefore you can modify the Physic Material properties and lower them to reduce the negative impact on the ground collisions that reduce the car's speed, therefore making the driving less fun and more slow.
{% endhint %}

{% hint style="info" %}
If you leave the physic material field as NULL in the Project-Wide Surface Settings tab, when the surface parameters will be requested by the wheel, it will receive the default (0,1,1,0) surface properties, even if you set your own surface properties.&#x20;
{% endhint %}

{% hint style="info" %}
The physic material and surface settings are stored as 2 separate lists, which get converted to the dictionary at runtime. Therefore, you cannot have the same physic materials in the list because a dictionary can only have unique keys. If you have more than 1 physic material in the list, only the first one will be added to the dictionary.

You can check the Scriptable Object that holds the project surface settings at <mark style="color:orange;">"CustomVehicleController/VehicleController/Resources"</mark>. Since the amount of items in lists must match, this asset is read-only and can only be modified from the settings window.

![](https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2FBiPjbMwlH6yumM6Qaafa%2Fimage.png?alt=media\&token=c2183f6c-2e01-4f47-bca8-a7d99358d2ee)
{% endhint %}

{% hint style="info" %}
In order to create new Physic Materials, click RMB in the Assets folder and navigate:

![](https://3780384024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVPyvySfaC85jUgVcDPRJ%2Fuploads%2Fp0UlGuBbdv8es4ly0K2o%2Fimage.png?alt=media\&token=3bc0b810-d8e5-452c-81ce-bf169d37cd90)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://distubredone322.gitbook.io/custom-vehicle-controller/guides/package-settings/project-wide-surface-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
