Raycasting in parallel on a worldmodel crashes studio

Just as the title describes, raycasting on a worldmodel in parallel crashes studio, even only with 2 actors and 1 baseparts in the worldmodel
It doesn’t appear to crash if there’s only one actor

WorldmodelParallelRaycastRepo.rbxl (46.0 KB)

Thanks for the repro. We’ll take a look.

A bit of a necro-bump, but I ran into this independently today. I was able to find a workaround, and that was to yield for at least one physics frame after parenting the WorldModel. Even if it’s parented on PreSimulation and you wait until PostSimulation fires, you’re good.

The root issue here is that we don’t yet support Actors in Plugins. I’ve made a patch that throws an error if this occurs, and we are also working on a way to allow Actors to work in Plugins anyway. I’ll keep you updated on our progress!

1 Like

I’m a bit confused by this, because Actors do work in plugins, I use them in quite a few of mine

Do you mean that they work unintentionally?

Because while you can’t instantiate actors once the plugin has loaded(i.e :Cloning() them and reparenting doesn’t run the scripts), you can copy+paste however many you need into a folder and the scripts will run as expected when the plugin loads - and parallel luau does work with it

Yeah, Actors work in Plugins at the moment, but they shouldn’t :sweat_smile: I’d call Parallel Lua’s operation in Plugins “undefined behavior” at best. If it works for you, that’s great, but occasionally something (like raycasting) will crash Studio or have unexpected behavior.

1 Like

The fix for this issue is rolling out now. It turns out it was an issue with having multiple worldmodels and then going into parallel execution. Please let me know if you experience any further crashes!