> For the complete documentation index, see [llms.txt](https://heroicsolo.gitbook.io/heroic-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heroicsolo.gitbook.io/heroic-engine/basics/engine-utilities/materialextensions.md).

# MaterialExtensions

This class provides extension methods for switching material from opaque mode to transparent mode or vice versa. This could be useful for creating invisibility effects on characters.

### Available methods

{% hint style="info" %}
Next methods are not guaranteed to work well with all shaders and materials. Use them at your own risk.
{% endhint %}

***

```csharp
public static void ToOpaqueMode(this Material material)
```

*This extension method tries to switch given material to opaque mode, if possible.*

*Example:*

```csharp
renderer.material.ToOpaqueMode();
```

***

```csharp
public static void ToFadeMode(this Material material)
```

*This extension method tries to switch given material to transparent mode, if possible.*

*Example:*

```csharp
mat.ToFadeMode();
Color col = mat.color;
col.a = 0.15f; //Make material transparent by 85%
mat.color = col;
```
