How to load parts into a player's plot?

I have a building game where the player can save/load their creations. However, I realized all too late that the player’s plot would change between play sessions. How would I offset their buildings according to their new plot (assuming both plots are the same size).

Hey there! I think this may help solve your problem. How to make a Tycoon in Roblox #8 - Saving Player Data [READ PINNED COMMENT] - YouTube

That video didn’t show how to offset/translate a vector3 to fit a potentially different plot. Basically, if I have a positional vector3 which I know to be inside a plot, how would I translate that to fit another of the same plot in a different location?

When you save, use the relative offset:

savedData = plot.CFrame:ToObjectSpace(itemToSave.CFrame)

When you load, convert back to world space

itemToLoad.CFrame = plot.CFrame:ToWorldSpace(savedData)
2 Likes

Oh, I was just calling ToObjectSpace when I was loading it, and that was causing it to snap to the center of the player’s plot.

Whenever I do this the build loads very far back, why would that be happening?

I dunno, could you share your code?

Nvm I just fixed it!! I had to save the player’s last plot in my datastore and offset the part based on they when loading. I’ve been working on this for so long thank you so much :):slight_smile: