a19_9
(Nol)
July 26, 2023, 1:11am
7
you have to save the models cframe relative to the plot its on, then when youre loading you have to set its cframe relative to the new plot
These 2 solutions by Tiffblocks work the best
I think I might have mixed up the order you need to multiply the CFrames in, sorry!
Maybe try these versions?
local CFramePosition = TycoonValue.Value.TycoonBaseplate.CFrame * CFrame.new(unpack(v.Position))
local SavingCF = {(TycoonValue.Value.TycoonBaseplate.CFrame:Inverse() * v.PrimaryPart.CFrame):components()}
You should save the position relative to the base instead of relative to the world origin.
For example, if each base is a model with a PrimaryPart set in a consistent way, then you could write:
local cframeToSave = baseModel.PrimaryPart.CFrame:Inverse() * itemObject.CFrame
-- later, after retrieving from data store
local cframeToSet = baseModel.PrimaryPart.CFrame * cframeFromDataStore
Edit: My original code was incorrect because I had the left and right sides of the multiply flipped around. I…