# Getting all (public) properties of a UClass

**URL:** <https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466>\
**Category:** C++\
**Tags:** properties, UClass, unreal-engine, question, CPP\
**Created:** [February 14, 2016, 6:30pm UTC](https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466 "2016-02-14T18:30:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiruse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiruse](https://forums.unrealengine.com/u/Kiruse)\
**Post date:** [February 14, 2016, 6:30pm UTC](https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466/1 "2016-02-14T18:30:16Z")

</div>

Hey there,

I know it is possible to check if the `UClass` has a particular `UProperty` using `HasProperty()`, but I do not even know how go get such a `UProperty`. I had imagined the `UClass` would contain methods to check for properties by their names, or to get all properties, but it would seem I’d be wrong there.

I’ve done several Google searches and am still searching to find any tutorial or other relevant information in the documentation, but my search so far has been in vain. Thus I thought I’d ask here to maybe speed up things.

Thank you for any information!

Zyr

---

<div class="post-metadata">

**Author:** ![Kiruse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kiruse](https://forums.unrealengine.com/u/Kiruse)\
**Post date:** [February 16, 2016, 8:43pm UTC](https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466/2 "2016-02-16T20:43:56Z")

</div>

I found what I was looking for. It is possible to iterate over the fields of a class using the `TFieldIterator` type and the `FindField()` global function.

Example for `TFieldIterator`:

```
for( TFieldIterator<UBoolProperty> Prop(MyUClassPtr); Prop; ++Prop ) {
    bool val = Prop->GetPropertyValue(MyUObjectPtr);
}

```

where `MyUClassPtr` is a pointer to an instance of `UClass` and `MyUObjectPtr` is a pointer to an instance of `UObject`.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1cdfa42d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1cdfa42d](https://forums.unrealengine.com/u/anonymous_user_1cdfa42d)\
**Post date:** [September 21, 2018, 5:55pm UTC](https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466/3 "2018-09-21T17:55:33Z")

</div>

If you want to iterate over every `UPROPERTY` regardless of its type then you can use `TFieldIterator<UProperty>` instead, just fyi.

---

<div class="post-metadata">

**Author:** ![Levitikon217](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Levitikon217](https://forums.unrealengine.com/u/Levitikon217)\
**Post date:** [July 30, 2021, 10:03am UTC](https://forums.unrealengine.com/t/getting-all-public-properties-of-a-uclass/347466/4 "2021-07-30T10:03:21Z")

</div>

It’s `FProperty` these days btw.
