GetPartBoundsInBox unable to find parts parented to workspace

Reproduction Steps
Parenting a part to workspace, and then running workspace:GetPartBoundsInBox() to find this part within the same frame will return no results. If there is a wait added between parenting and calling the function, it is able to find the part.

This can be seen in our repro file. The part is created at the CFrame of the red part on run time, and then GetPartBoundsInBox() is called immediately after. Output prints results of the function.

With a task.wait():
RobloxStudioBeta_ajGzp0YkHH

With no task.wait(), can see the part is physically there but nothing prints in output:

repro.rbxl (34.8 KB)
Inside of the repro file is a Script under workspace. Can replicate this 100% of the time by commenting out the selected task.wait()
RobloxStudioBeta_Vj9GSaUqp6

This behavior only happens on the server. It’s not an issue on clients.

Expected Behavior
This call shouldn’t require a frame wait.

Actual Behavior
Your code has to wait a frame before doing a bounds check after parenting the part to workspace.

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2022-02-25 00:02:00 (-08:00)

4 Likes

Possibly related:

Thanks for the report, reverting the change

1 Like

Thanks for the quick follow up!

1 Like