Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Nov 5, 2025

Resolves #2387

Unity does not permit the start of coroutines outside the main thread. When inside a burst job, this will actually cause a crash.

The changes here do not just prevent the crash but also enable the SDK to capture a screenshot when an event gets captured on a background thread.
This is achieved by checking whether the current thread is the main thread and if not, "enqueuing" the coroutine to be invoked on the next frame.

I'll follow up on the docs with the limitation of capturing the screenshot on the next frame. The fact that an event is not coming from the main thread is on the issue itself, see

Screenshot 2025-11-06 at 19 28 30

@bitsandfoxes bitsandfoxes changed the title fix: Screenshot capture in non-main thread settings fix: Screenshot capture in non-main thread setting Nov 5, 2025
@bitsandfoxes bitsandfoxes requested a review from a team November 6, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screenshot triggered from LogError in bursted job leads to crash

3 participants