# GetHashCode()

> Returns the hash code for the object.

## Definition

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

```csharp
public override int GetHashCode()
```

### Returns

| Type                                                       | Description                   |
| ---------------------------------------------------------- | ----------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The hash code for the object. |

### Remarks

The hash code is stable for the object and doesn't change if you modify the object's fields, so you can safely use an object as a key in a hash-based collection such as a `Dictionary` or `HashSet`. The hash code is consistent with Equals: two references that are equal return the same hash code.
