# GetVector

> Get a vector from the property block.

## Definition

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

## GetVector(string)

Get a vector from the property block.

```csharp
public Vector4 GetVector(string name)
```

### Parameters

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

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector4](/engine/6000.7/script-reference/unityengine/vector4.md) |             |

### Remarks

Returns zero vector if not found. If the value is previously set using [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md), the returned vector value is the sRGB color value converted for the active color space.

Additional Resources: [MaterialPropertyBlock.GetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/getcolor.md), [MaterialPropertyBlock.SetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setvector.md), [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md).

## GetVector(int)

Get a vector from the property block.

```csharp
public Vector4 GetVector(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 |
| ----------------------------------------------------------------- | ----------- |
| [Vector4](/engine/6000.7/script-reference/unityengine/vector4.md) |             |

### Remarks

Returns zero vector if not found. If the value is previously set using [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md), the returned vector value is the sRGB color value converted for the active color space.

Additional Resources: [MaterialPropertyBlock.GetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/getcolor.md), [MaterialPropertyBlock.SetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setvector.md), [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md).
