Introduction: I'm creating a system that requires me to save a models rotation and retrieve it once the player joins back. I've successfully uploaded, retrieved, and used accordingly all data about the model except it's rotation. I've been working on this for a few days, i'm finally ready to admit that I need help.
Question: How would I get the rotation of a model, store it on DataStore, and retreive it. I wish it was as easy as uploading the whole CFrame values - the position but you can't upload CFrame values to DataStore. I've tried converting the CFrame data to EulerAngles and reconverting to CFrame, it will upload the data but comes back as nil once i try to retreive it, even though it sucessfully uploaded the EulerAngles. I'm likely overthinking this.
Summary: I need to upload the rotation of a model to DataStore. I then need to be able to retrieve the data and set the models new rotation without altering the Model.Position (Vector3).
Side Question: To rotate models I've been setting the PrimaryPart's CFrame which does not automatically change the other parts of the model so i'm running each part through a Transform script I found on another forum, it's a little messy. If you have a good way to rotate a whole model, i will love you forever, in a non-weird way.
Things I've discovered:
- In order to upload a table to a DataStore the keys have to be strings.
- You can not directly store CFrame values to a DataStore
- Model.PrimaryPart.CFrame - Model.PrimaryPart.Position= Returns Rotation Only

3 comments
Yeah just use :components(). You don't even need the json stuff.
First of all, thanks for the help! These are the values of each
I posted an answer with the next problem