android / android/tuningfork

InvalidAnnotation when loading scene from AssetBundle

Open
#43 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
62
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Anytime we load scene from AssetBundle, APT logs as error `Error Unity SetCurrentAnnotation({ }) result is InvalidAnnotation`.
This is caused by Scene.sceneIndex returning -1
https://docs.unity3d.com/ScriptReference/SceneManagement.Scene-buildIndex.html

We fixed it for now by implementing custom annotation, but it's a bit annoying and it took us a lot of time searching for why is this happening.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the error while loading a scene from an AssetBundle, then inspect how Scene.sceneIndex is used before SetCurrentAnnotation. Confirm the behavior against Unity's Scene-buildIndex documentation. Done means AssetBundle scenes no longer produce an InvalidAnnotation error without requiring custom annotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.