I need a bunch of my entities to essentially raycast inside a system. I’m trying to implement the code found at the bottom of this page inside of Entities.ForEach.Run. It is my understanding that this will just run on the main thread, so behavior should not differ too much from normally scheduling this job. But I keep getting a burst error
Burst error BC1059: Method `Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1<RaycastJob>.Execute(ref T, System.IntPtr, System.IntPtr, ref Unity.Jobs.LowLevel.Unsafe.JobRanges, int)` is being compiled as a function pointer, but both it and its declaring class `Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1` are missing the [BurstCompile] attribute. To fix this error, add the [BurstCompile] attribute to `Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1<RaycastJob>.Execute(ref T, System.IntPtr, System.IntPtr, ref Unity.Jobs.LowLevel.Unsafe.JobRanges, int)` and `Unity.Jobs.IJobParallelForExtensions.ParallelForJobStruct`1`.
I’ve tried adding burstcompile tags all over the raycast functions, but it seems like it needs to be somewhere under the hood. Does anyone have a good efficient way to do a dots physics raycast inside an entities.foreach and get around this?