{"record":{"id":"a7507fbdd40cae1b","repo":"Cysharp/UniTask","slug":"target-playerlooptiming-is-not-injected-please-ch","errorCode":null,"errorMessage":"Target playerLoopTiming is not injected. Please check PlayerLoopHelper.Initialize. PlayerLoopTiming:","messagePattern":"Target playerLoopTiming is not injected\\. Please check PlayerLoopHelper\\.Initialize\\. PlayerLoopTiming:","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs","lineNumber":504,"sourceCode":"            copyList[i].subSystemList = InsertUniTaskSynchronizationContext(copyList[i]);\n\n            playerLoop.subSystemList = copyList;\n            PlayerLoop.SetPlayerLoop(playerLoop);\n        }\n\n        public static void AddAction(PlayerLoopTiming timing, IPlayerLoopItem action)\n        {\n            var runner = runners[(int)timing];\n            if (runner == null)\n            {\n                ThrowInvalidLoopTiming(timing);\n            }\n            runner.AddAction(action);\n        }\n\n        static void ThrowInvalidLoopTiming(PlayerLoopTiming playerLoopTiming)\n        {\n            throw new InvalidOperationException(\"Target playerLoopTiming is not injected. Please check PlayerLoopHelper.Initialize. PlayerLoopTiming:\" + playerLoopTiming);\n        }\n\n        public static void AddContinuation(PlayerLoopTiming timing, Action continuation)\n        {\n            var q = yielders[(int)timing];\n            if (q == null)\n            {\n                ThrowInvalidLoopTiming(timing);\n            }\n            q.Enqueue(continuation);\n        }\n\n        // Diagnostics helper\n\n#if UNITY_2019_3_OR_NEWER\n\n        public static void DumpCurrentPlayerLoop()\n        {","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/Cysharp/UniTask/blob/ceac8d6946b1125fe782cd171fbcb245b567dbf9/src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs#L486-L522","documentation":"Thrown by PlayerLoopHelper.AddAction or AddContinuation when the runner (or yielder) for a given PlayerLoopTiming is null — meaning that timing was not injected during Initialize. UniTask routes await continuations and delay tasks through player-loop runners indexed by timing; if the runner was never created, the action cannot be queued.","triggerScenarios":"Using await UniTask.Delay(..., timing: PlayerLoopTiming.FixedUpdate) or similar when PlayerLoopHelper was initialized with an InjectPlayerLoopTimings mask that excluded FixedUpdate. Or PlayerLoopHelper.Initialize was never called (though the default RuntimeInitializeOnLoadMethod usually covers this).","commonSituations":"A custom Initialize call that passes a restricted InjectPlayerLoopTimings value (e.g., only Update) but code later uses LateUpdate or FixedUpdate timing. Another plugin re-initialized the player loop after UniTask, clearing its injected runners. Disabling the default RuntimeInitializeOnLoadMethod initialization.","solutions":["Call PlayerLoopHelper.Initialize() with InjectPlayerLoopTimings.All (the default) to inject all timing runners.","If using a custom InjectPlayerLoopTimings mask, ensure it includes every PlayerLoopTiming value your code uses.","Verify Initialize was actually called — check for script execution order issues or disabled RuntimeInitializeOnLoadMethod.","If another plugin reinitializes the player loop, re-call PlayerLoopHelper.Initialize() afterward."],"exampleFix":"// before (restricted mask misses FixedUpdate)\nPlayerLoopHelper.Initialize(InjectPlayerLoopTimings.Minimum); // only Update\nawait UniTask.DelayFrame(1, timing: PlayerLoopTiming.FixedUpdate); // throws\n\n// after\nPlayerLoopHelper.Initialize(); // default: InjectPlayerLoopTimings.All\nawait UniTask.DelayFrame(1, timing: PlayerLoopTiming.FixedUpdate); // ok","handlingStrategy":"validation","validationCode":"// Ensure all timings are injected\nPlayerLoopHelper.Initialize(); // default uses InjectPlayerLoopTimings.All\n// If using a custom mask, include every timing you will use:\n// PlayerLoopHelper.Initialize(\n//     InjectPlayerLoopTimings.Update | InjectPlayerLoopTimings.FixedUpdate |\n//     InjectPlayerLoopTimings.LateUpdate /* ... */);","typeGuard":null,"tryCatchPattern":"try\n{\n    await UniTask.Delay(TimeSpan.FromSeconds(1), timing: PlayerLoopTiming.FixedUpdate);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"not injected\"))\n{\n    // Re-initialize with all timings\n    PlayerLoopHelper.Initialize();\n    await UniTask.Delay(TimeSpan.FromSeconds(1), timing: PlayerLoopTiming.FixedUpdate);\n}","preventionTips":["Call PlayerLoopHelper.Initialize() with the default (InjectPlayerLoopTimings.All) unless you have a specific reason to restrict timings.","If another plugin reinitializes the player loop, re-call PlayerLoopHelper.Initialize() afterward.","Audit all PlayerLoopTiming values used in your codebase and ensure your InjectPlayerLoopTimings mask covers them."],"tags":["player-loop","initialization","timing","startup"],"backgroundTag":null,"analyzedSha":"ceac8d6946b1125fe782cd171fbcb245b567dbf9","analyzedAt":"2026-08-13T19:16:39.025Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}