Here’s a weird one. I have this ObjectValue and I’m setting its value to an AnimationTrack. When the script that’s accessing the value initially reads it the track is there, but after waiting for a while the track vanishes and .Value is set to nil. I think it’s getting garbage collected, but that shouldn’t happen since the ObjectValue is referencing it… right?
Here’s a dance potion where you can see it in action: Dropbox - Error - Simplify your life
“Script” creates the AnimationTrack and clones TrackScript, then sets TrackScript.Track.Value to the AnimationTrack. TrackScript reads the value when it starts and prints the value, and it does the same thing after waiting a couple seconds. The value magically vanishes.
---Activated---
Tool Script: Track is AnimationTrack | Value is AnimationTrack
TrackScript A: Value is AnimationTrack
TrackScript B: Value is nil
To make it work I ended up using _G to contain a reference to the AnimationTrack, and that worked fine.