#How do I grab the camera?
1 messages · Page 1 of 1 (latest)
you have a few options:
- do whatever heavy computation you need in burst, save the results to an unmanaged component, and then use a non-burst system to apply the results to the camera (or its follow target)
- use a TransformAccessArray to modify the camera's transform directly from a job
- use a function pointer to invoke managed code from burst (see #1064581837055348857 message)
my recommendation is 1. because it's the simplest and you most likely only have a handful of cameras at most so there would be no real performance benefit to the other approaches
If you upgrade your project to Unity 6.3 you can use TransformHandle which is even simpler than option 1.
https://docs.unity3d.com/6000.3/Documentation/ScriptReference/TransformHandle.html
ohh TIL, that's nice