Query VS Each

well hiya, this is more of a discussion topic than an actual question so…

Which do you use more often?

  • Query
  • Each
0 voters

as far as i know, with Each you can use more methods than Query, as Query cannot :FindChildren().

also i just implemented a debounce into my killbrick script (also i have 1 script manage all killbricks lol)

Each seems to be good.

Query can GetChildren, as it also returns the instances that have the matched component/pair via query.Instance[index]. In general, Query is basically Each but can do more. For instance, you can’t query for the existence of multiple components with Each, and you can filter components WITHOUT a specific component with Each as well. I haven’t tested it, but I wouldn’t be surprised if Query was more performant as well.

That being said, I still use Each more than Query because it’s just easier to use, and 99% of the time I’m querying for something specific because I want the instances that came from the query, not also the components.

1 Like