# CreatePropertyAttribute

> Use this attribute to have a property generated for the member.

## Definition

* **Type:** Class
* **Namespace:** [Unity.Properties](/engine/6000.5/script-reference/unity/properties.md)
* **Assembly:** UnityEngine.PropertiesModule

```csharp
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class CreatePropertyAttribute : RequiredMemberAttribute
```

## Remarks

By default public fields will have properties generated.

## Properties

| Property                                                                                         | Description                                         |
| ------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
| [ReadOnly](/engine/6000.5/script-reference/unity/properties/createpropertyattribute/readonly.md) | Indicates if the property should generate a setter. |
