Hi everyone. I'm having trouble with some code that I use in Unity. The idea is that I get the tracking info of an object from a camera in real world and I use this info in Unity to move accordingly an object in the simulation. The problem is that inside the function that takes the info (NDIApplyTransformation in photo) the communication between computer and camera is based on a buffer read and until the read is not available the function does not give any info. I've tried using thread as in photo (even with lock of c#) but the lag remains. Can anyone suggest me a solution?
#Rendering lag due to some code
1 messages · Page 1 of 1 (latest)
Have you run the profiler to make sure that this is the actual root of the problem?
Also !code
Posting code
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
Also https://screenshot.help/ if you need to post screenshots of things other than code