Large Behavior Change: Raycasting No Longer Possible ParallelLua

Reproduction Steps

RaycastParameters can no longer be adjusted in parallel, making it incredibly difficult to run raycasts in parallel scripts. Specifically FilterDescendantsInstances can’t be set

Expected Behavior

The original behavior of ParallelLua allowed for FilterDescendantsInstances and it worked perfectly

Actual Behavior

Both in game and in studio Parallel scripts trying to raycast error out because FilterDescendantsInstances no longer works in parallel

Workaround

No

Issue Area: Engine
Issue Type: Other
Impact: High
Frequency: Constantly
Date First Experienced: 2022-05-12 00:05:00 (+12:00)
Date Last Experienced: 2022-05-16 00:05:00 (+12:00)

7 Likes

Thanks for reporting this. This was actually a planned change to the parallel Lua API surface that we were rolling out as we prepare for release. To fix thread safety issues, the easiest thing for us to do was to mark this property thread unsafe. We assumed most users would set up one set of RaycastParamaters with a static set of filters in the serial phase, and use that object over and over in the parallel phase.

Would you mind sharing a bit about what your code is doing that requires changing the filter list during the parallel phase?

1 Like

It just creates new raycast parameters everytime the function is called because for ease of use I wrote a function that can be called like the old workspace:FindPartOnRay’s but uses the newer more efficient raycast system.

Sorry to bump the old thread, but we want to provide a conclusion for all bug reports.

A new method was added to help with updates of the filter list: RaycastParams | Documentation - Roblox Creator Hub

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.