# Scene Graph \`FindComponents\` method is bugged

**URL:** <https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [June 13, 2024, 7:29pm UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153 "2024-06-13T19:29:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knight\_Breaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/knight_breaker/32/1194711_2.png) [@Knight\_Breaker](https://forums.unrealengine.com/u/Knight_Breaker)\
**Post date:** [June 13, 2024, 7:29pm UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153/1 "2024-06-13T19:29:44Z")

</div>

### Please select what you are reporting on:

Verse

### What Type of Bug are you experiencing?

Verse

### Summary

`FindComponents` is bugged. It does not return expected results.

### Steps to Reproduce

Add multiple components to an entity, including custom verse components.

```auto
verse_component := class(component) {}

test_query_component<public> := class(verse_component) {
  @editable
  Name: string = ""

  OnBeginSimulation<override>(): void = {
    (super:)OnBeginSimulation()
    Print("{Name} test_query_component OnBeginSimulation")
  }

  OnSimulate<override>()<suspends>: void = {
    Print("{Name} test_query_component OnSimulate")
    Sleep(2.0)
    Components := Entity.FindComponents(component)
    Print("components {Components.Length}")
    for (C: Components) {
      if (A := test_query_component[C]) {
        Print("is test_query_component")
      } else if (A := test_order_component[C]) {
        Print("is test_order_component")
      } else if (A := test_sg_component[C]) {
        Print("is test_sg_component")
      } else if (A := transform_component[C]) {
        Print("is transform_component")
      } else if (A := mesh_component[C]) {
        Print("is mesh_component")
      }
    }

    VCs := Entity.FindComponents(verse_component)
    Print("verse components {VCs.Length}")

    for (C: VCs) {
      if (A := test_query_component[C]) {
        Print("is test_query_component")
      } else if (A := test_order_component[C]) {
        Print("is test_order_component")
      } else if (A := test_sg_component[C]) {
        Print("is test_sg_component")
      } else if (A := transform_component[C]) {
        Print("is transform_component")
      } else if (A := mesh_component[C]) {
        Print("is mesh_component")
      }
    }

    TestQ := Entity.FindComponents(test_query_component)
    Print("test_query_component {TestQ.Length}")
  }
}

```

### Expected Result

The components returned should be totally different.

- `Entity.FindComponents(verse_component)` should yield a list of all components, not just one. In my case 6 components.
- `Entity.FindComponents(verse_component)` should yield 3 components (all custom verse components).

### Observed Result

[2024.06.13-21.20.48:850][601]LogVerse: : components 1 ❌ (should be 6)  
[2024.06.13-21.20.48:850][601]LogVerse: : is transform\_component  
[2024.06.13-21.20.48:850][601]LogVerse: : verse components 1 ❌ (should be 3)  
[2024.06.13-21.20.48:850][601]LogVerse: : is test\_order\_component  
[2024.06.13-21.20.48:850][601]LogVerse: : test\_query\_component 1

### Platform(s)

PC

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [June 13, 2024, 9:45pm UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153/2 "2024-06-13T21:45:51Z")

</div>

The status of FORT-757703 incident has been moved from ‘Needs Triage’ to ‘Closed’. Resolution Reason: ‘Fixed’

---

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [June 14, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153/3 "2024-06-14T13:54:46Z")

</div>

Thank you, the team is taking a look.

---

<div class="post-metadata">

**Author:** ![UCONNGabe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UCONNGabe](https://forums.unrealengine.com/u/UCONNGabe)\
**Post date:** [June 16, 2024, 1:46am UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153/4 "2024-06-16T01:46:37Z")

</div>

According to the documentation, some of this behavior is not a bug.

```auto
Currently UEFN will not allow you to add more than one component of a given subclass of component (for example, only one type of light_component). This restriction will be relaxed in the future where components will be able to decide if they wish to allow only one instance or many instances of the same component to existtogether on one entity.

```

---

<div class="post-metadata">

**Author:** ![Knight\_Breaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/knight_breaker/32/1194711_2.png) [@Knight\_Breaker](https://forums.unrealengine.com/u/Knight_Breaker)\
**Post date:** [June 16, 2024, 5:08am UTC](https://forums.unrealengine.com/t/scene-graph-findcomponents-method-is-bugged/1902153/5 "2024-06-16T05:08:53Z")

</div>

This is incorrect and you’re reading the report wrong. Fetching over a common super type should yield multiple results unless there is really only one or none component that would be a subtype of the requested component type. Requesting components over `component` should always yield all attached components, but it currently doesn’t, which is clearly a bug.
