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.
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