# How do I find a component by name?

**URL:** <https://forums.unrealengine.com/t/how-do-i-find-a-component-by-name/288333>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 16, 2014, 6:54am UTC](https://forums.unrealengine.com/t/how-do-i-find-a-component-by-name/288333 "2014-07-16T06:54:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [July 16, 2014, 7:51am UTC](https://forums.unrealengine.com/t/how-do-i-find-a-component-by-name/288333/2 "2014-07-16T07:51:04Z")

</div>

you can make your own component, and give it the name variable you want,

**wiki tutorial: Custom BP-friendly UObject Components**

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

then you can find it by doing this

```
for(TObjectIterator<UYourCompClass> Itr; Itr; ++Itr)
{
   if(Itr->YourStringVariableName = "YourName")
  {
     //do stuff!
     return;

  }
}
```

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-i-find-a-component-by-name/288333)._
