[BUG] CharacterStore: Missing DontDestroyOnLoad causes NullRefs on scene load #7
Labels
No labels
architecture
bug
duplicate
enhancement
help wanted
invalid
performance
quality
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lavarius/ProjectOverlay#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🔴 Critical Bug
File:
CharacterStore.csThis singleton gets destroyed on scene load, causing
NullReferenceExceptionin any system that holds a reference to it across scenes.Fix: Add to
Awake():Fixed in PR #31 (
feat/persistent-character-system).CharacterStore.Awake()now callsDontDestroyOnLoad(gameObject)with a singleton guard to destroy duplicates. The character is spawned once in the Loading Screen and persists across all scene transitions. Each game scene has aCharacterSpawnPoint+CharacterSceneInitializerthat teleports it to the correct position on arrival.