# GetRefROOptional(Entity)

> Obsolete. Use ComponentLookup<T>.TryGetRefRO instead.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

> **Warning:**
>
> **Deprecated.** This function was not intended to be in the public API, and it will be removed in a future release.

```csharp
public RefRO<T> GetRefROOptional(Entity entity)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The referenced entity

### Returns

| Type                                                                  | Description                                                                                                      |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [RefRO\<T>](/engine/7000.0/script-reference/unity/entities/refro1.md) | Returns a safe reference to the component data, or an invalid reference if `entity` does not have component `T`. |
