How to make a tool which saves data to the game and reloads the saved data

Hello Developers :wave:
The title might be confusing to understand, but let me explain it for you, bit by bit.
I want to create a tool which saves the Camera’s CFrame to the whole game, and reloads the Camera’s CFrame to the saved one once the game is re-run.
The problem is that, I don’t know have any clue on to make that.
The tool will be used on the client and the saves are to be made on the server.

Looking forward to a response! :grinning:
Thank you!

1 Like

Do you want it to act like a save point so the next time you reload the game, you are at the exact same spot with the same camera angle?

1 Like

yes please.
The tool was meant to be used to edit the camera’s Coordinate Frame for a Jumpscare, which could be used for debugging the camera’s position and orientation.

1 Like

I guess you could make a tool with a LocalScript which fires a RemoteEvent with the Character’s CFrame and the Camera CFrame as an argument. On the server you could make a script which responds to the event by saving it to a DataStore and reloading the CFrames the next time the player rejoins.

1 Like

I could do that, but the problem is that the CFrame of the camera should be relative to a model.

1 Like

You can do local CameraCFrame = Character.HumanoidRootPart.CFrame:ToObjectSpace(Camera.CFrame) to get the Cameras position relative to the character.

To do it the other way around you can do Camera.CFrame = Character.HumanoidRootPart.CFrame:ToWorldSpace(CameraCFrame)

1 Like

Thank you so much!
I’ll try it out :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.