# SetFloat

> Sets the value of a float uniform.

## Definition

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

## SetFloat(int, float)

Sets the value of a float uniform.

```csharp
public void SetFloat(int nameID, float val)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the property as given by Shader.PropertyToID.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The float value to set.

### Remarks

Only shaders defined in the .raytrace file can access the value you designate as the argument for this method. To make this value accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the [Shader.SetGlobalFloat](/engine/6000.0/script-reference/unityengine/shader/setglobalfloat.md) method instead.

## SetFloat(string, float)

Sets the value of a float uniform.

```csharp
public void SetFloat(string name, float val)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property being set.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The float value to set.

### Remarks

Only shaders defined in the .raytrace file can access the value you designate as the argument for this method. To make this value accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the [Shader.SetGlobalFloat](/engine/6000.0/script-reference/unityengine/shader/setglobalfloat.md) method instead.
