videokit-ai / videokit

Low-code, cross-platform media SDK for Unity Engine. Register at https://videokit.ai
https://videokit.ai
Apache License 2.0
107 stars 14 forks source link

Unity Freezes when Camera starts running on Awake #134

Closed jkorn2324 closed 3 months ago

jkorn2324 commented 4 months ago

Unity freezes forever (no crash) whenever someone first starts running the game and the VideoKitCameraManager is set to Play On Awake. Here is additional info:

olokobayusuf commented 4 months ago

@jkorn2324 can you share the Editor logs?

jkorn2324 commented 4 months ago

Here is the editor log file from the last time I was able to reproduce it:

Editor.log

olokobayusuf commented 4 months ago

@jkorn2324 can you reproduce this in an empty project? Your logs indicate that you've got a number of other packages in your project. We'd need to isolate this issue to VideoKit itself.

jkorn2324 commented 4 months ago

I wasn't able to reproduce the issue in an empty project, but was able to still reproduce it in my other project. I did some debugging and what I found was the human texture capabilities functionality caused issues in my project. Whenever I turned the Human Texture Capabilities off, it would freeze Unity completely, but when I turned Human Texture Capabilities on, it would work completely fine.

For some reason, it would still trigger this code block even if there were no Capabilities marked in the Unity Editor:

Screenshot 2024-07-24 at 9 15 37 PM

EDIT: What happened was my capabilities was marked as "2" even if it said "Nothing" in the Unity Editor. Might have been an issue from updating VideoKit from 0.0.17 and 0.0.19.

olokobayusuf commented 3 months ago

@jkorn2324 are you saying this issue doesn't happen once you properly set the Capabilities setting? So Unity freezes when the human texture capability is on, but not off?

jkorn2324 commented 3 months ago

Yes - when the Capabilities setting is properly set, everything works fine. But when it isn't (for me the Capabilities setting was set to 2) that's when Unity freezes - when this would happen, the Capabilities would be marked in the Unity Editor as "Nothing" even though the value was 2.

olokobayusuf commented 3 months ago

@jkorn2324 I think you can zero out the value by resetting the camera manager component. Click the three dots in the right corner of the component and click Reset.