Does Instance:GetDebugId() Persist?

I’m using it like this:

  1. I call workspace:GetDebugId() & get a value
  2. I reload Studio entirely
  3. I call workspace:GetDebugId() & get a value

Are these two values the same always, no matter how many times it’s reloaded, and do they ever change?

1 Like

I’ve never used this function before, but I assume you can test that:

Run this in the command bar before reloading, then reload studio and run again.

print(workspace:GetDebugId())

(The values will show in the output)

According to the documentation of the function, it is used for differentiating one object from another, specifying a case where the name might be the same. It seems like it is only different between objects as they are inserted/loaded, rather than depending on any properties or anything that’d persist.

Depending on what you are attempting to do it could be better to not rely on that function and instead generate something unique depending on what you’re trying to identify uniquely and why - such as the properties of the object or if it’s a script, generating a unique hash of the code inside of it.

Answer is no, unfortunetly.

I tried to use it to save instance data for my plugin a few days ago but found out quickly that it’s not designed for that.

Your best bet would be use Collection tags and HttpService:GenerateGUID().

2 Likes

Yup, that’s exactly what I’m using it for - plugin data saving.