# TryGetRefRO(Entity, out RefRO<T>)

> Attempts to get a safe reference to the component data, failing gracefully if the component isn't present.

## Definition

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

## TryGetRefRO(Entity, RefRO\<T>)

```csharp
public bool TryGetRefRO(Entity entity, out RefRO<T> outRef)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The target entity**** (\[RefRO\<T>]\(/engine/7000.0/script-reference/unity/entities/refro1)): The output reference will be stored here. See remarks.

### Returns

| Type                                                          | Description                                                                |
| ------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns true if component `T` exists on `entity`, or false if it does not. |

### Remarks

If `T` is a zero-size component, `outRef` will not contain a valid reference; zero-size components do not have an address in memory. However, this function will still return true or false depending on whether `entity` has component `T`.
