# SetInt

> This method is deprecated. Use Material.SetFloat or Material.SetInteger instead.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## SetInt(string, int)

This method is deprecated. Use [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md) or [Material.SetInteger](/engine/6000.7/script-reference/unityengine/material/setinteger.md) instead.

```csharp
public void SetInt(string name, int value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Property name, e.g. "\_SrcBlend".**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Integer value to set.

### Remarks

When setting values on materials using the Standard Shader, you should be aware that you may need to use [Material.EnableKeyword](/engine/6000.7/script-reference/unityengine/material/enablekeyword.md) to enable features of the shader that were not previously in use. For more detail, read [Accessing Materials via Script](/engine/6000.7/manual/materials-and-shaders/materials/accessing-via-script.md). This function is just an alias to [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md) that casts the passed value to a float.

## SetInt(int, int)

This method is deprecated. Use [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md) or [Material.SetInteger](/engine/6000.7/script-reference/unityengine/material/setinteger.md) instead.

```csharp
public void SetInt(int nameID, int value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Property name ID, use [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md) to get it.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Integer value to set.

### Remarks

When setting values on materials using the Standard Shader, you should be aware that you may need to use [Material.EnableKeyword](/engine/6000.7/script-reference/unityengine/material/enablekeyword.md) to enable features of the shader that were not previously in use. For more detail, read [Accessing Materials via Script](/engine/6000.7/manual/materials-and-shaders/materials/accessing-via-script.md). This function is just an alias to [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md) that casts the passed value to a float.
