Where should I begin with saving plot placements?

Okay, so I was working on using this tutorial and I’m going to do my own custom plot serializing to save their data.

In the game I’m working on, users will be able to select their own plots and then place items on it. I wanna be able to save the part position but have it be able to be loaded on another plot in a different position without it loading on their old plot. Does anyone have pointers / similar threads for an answer?

Potential solutions:

  • I think I’d need :ToWorldSpace but the wiki gives me a stroke trying to figure it out, any help would be appreciated
  • I could just make a proxy plot that’s at like 0,0,0 and place it on the plot and then load that plot but that’s a lot of effort

No clue if my post was remotely coherent because my brain is on fire right now

1 Like

Here’s how I do it:

local itemCFrame = {(plotPart.CFrame:Inverse() * itemModel:GetPivot()):GetComponents()}

And for the loading:

itemModelClone:PivotTo(selectedPlot.CFrame * CFrame.new(unpack(item.CFrame)))

The item here is just the value of the loading for loop.

That’s just a part of the code, but that’s at least what’s saving/loading the CFrame. Do have to admit, it works perfectly.

1 Like

Thanks, it worked excellently! Can you explain how it works a little? Sorry I didn’t respond faster, I had to actually make the data saving system.

1 Like

Really don’t know how to explain it, but all it’s doing is converting the item’s CFrame in the plot’s POV to a table with every CFrame component to make it save-able. Then for the loading, it just unpacks that table and creates a new CFrame out of it. Don’t know how to explain the rest, but I hope I wasn’t too confusing.

Nope, that made it more confusing but I appreciate the attempt! Thank you so much for your help though!

1 Like