# GetFloat

> Get a named float value.

## Definition

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

## GetFloat(string)

Get a named float value.

```csharp
public float GetFloat(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

Additional Resources: [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md), [Materials](/engine/6000.7/manual/materials-and-shaders/materials.md), [ShaderLab documentation](/engine/6000.7/script-reference/unityengine/shaders.md), [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Renderer rend = GetComponent<Renderer> ();
        rend.material.shader = Shader.Find("Specular");
        print(rend.material.GetFloat("_Shininess"));
    }
}
```

## GetFloat(int)

Get a named float value.

```csharp
public float GetFloat(int nameID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md).

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Remarks

Additional Resources: [Material.SetFloat](/engine/6000.7/script-reference/unityengine/material/setfloat.md), [Materials](/engine/6000.7/manual/materials-and-shaders/materials.md), [ShaderLab documentation](/engine/6000.7/script-reference/unityengine/shaders.md), [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md).

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Renderer rend = GetComponent<Renderer> ();
        rend.material.shader = Shader.Find("Specular");
        print(rend.material.GetFloat("_Shininess"));
    }
}
```
