My scripts randomly stop working after I reset my character

No
Why is this stupid 30 char limitation invented…

Found it.

Its due to the replication of the script. When a Player dies, any scripts in StarterCharacterScripts are essentially deleted as they are stored on the character.

In StarterPlayerScripts its copied directly to the Player, and as such when a new instance of the UI is created it doesn’t update the memory location.

In as simple terms as possible without making this an essay:

The value of “mainUI” doesn’t update when you die, as such its not updated to the latest UI instance.

For your eyes:
image

Red line marks when a player died, player script is a new instance of a local script stored in StarterPlayerScripts, character script is a new instance of a local script stored in StarterCharacterScripts. When you get given a new UI, its not the exact same as its predecessor.

6 Likes