- Home /
Question by
unity_Tfp-6ps0FNNfMA · Nov 15, 2020 at 08:39 AM ·
raycastpathfindingmultithreading
What kinds of functions can be called from a job?
Obviously, anything modifying the scene does not work, but is it possible, for example, to call Physics.Raycast or NavMesh.CalculatePath?
Comment
Best Answer
Answer by andrew-lukasik · Nov 15, 2020 at 09:31 AM
You're looking for: RaycastCommand, NavMeshQuery
Close to all of the legacy API (<2019) was written without thread safety as a priority. It made everything much simpler back then but, as you probably discovered, progressively useless today.
And this is why Unity is rewriting whole chunks of the engine for multi-threading right now. This whole dots tech thing or dots physics is a leading initiative for that. So:
Q: What kinds of functions can be called from a job?
A: Pretty much everything DOTS. Your own ones (while thread-safe ofc).
Your answer
