Skip to content

Commit

Permalink
Set SingletonBehaviour parent transform to null if DontDestroyOnLoad …
Browse files Browse the repository at this point in the history
…is used
  • Loading branch information
Exanite committed Nov 6, 2024
1 parent 6e11880 commit 8314b6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Components/SingletonBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ private void Initialize()

if (dontDestroyOnLoad)
{
transform.parent = null;

DontDestroyOnLoad(this);
}
}
Expand Down

0 comments on commit 8314b6e

Please sign in to comment.