I’m making a replay system and trying to save CFrames into it’s own each keyframe table, but when I json encode it, it disappears from the dictionary. I’ve searched around and wondering if there’s an alternative or what I am doing wrong? Can I save tables without encoding into datastores?
-- how i'm saving the cframes initially in a heartbeat
local cf = {char.HumanoidRootPart.CFrame:GetComponents()}
keyframes[plr.Name][c] = cf
-- later on
local enReplayData = HttpService:JSONEncode(replayData)
print(replayData) --[1] = 5.767, ["test2-easy"] = ▼ { [0] = ▶ {...},[1] = ▶ {...},[2] = ▶ {...}, etc
print(enReplayData) --[1] = [5.767]
It looks like you have a 0-index in test2-easy. That could be part of the issue. Also, mixed tables (i.e. tables with both number and string keys) could also be a problem.
:GetComponents returns 16 numbers, most of which aren’t necessary in the vast, vast majority of cases. Just save the Position and :ToOrientation.