// Setup the command and result buffers
var results = new NativeArray<RaycastHit>(1, Allocator.Temp);
var commands = new NativeArray<RaycastCommand>(1, Allocator.Temp);
Upon doing so, but with 8, instead of 1, Unity 2019.4 screams to me:
So then I changed from Temp to TempJob, and then the problem was solved.
Temp ̶c̶a̶n̶ ̶o̶n̶l̶y̶ ̶b̶e̶ ̶u̶s̶e̶d̶ ̶i̶n̶ cannot be passed to a bursted job. TempJob should be used instead; the documentation appears to be incorrect.
I gave my camera rig a nice plumage using the RaycastCommand. It was surprisingly easy to set up and use along with other jobs as well. It has one job to calculate the rays that the RaycastCommand-job depends on.
However, still not sure if RaycastCommand can be used with Burst as I can’t seem to find anything about it…