How to load parts according to the attributes of the parent parts?

I want the ability to move parts according to the angle and location of the area when loading parts into the area. To show you an example,

There are three zones like this.

스크린샷 2024-06-21 174000
The user will place the parts here and save them.

And the user loads it from another zone.

Then, the angles and positions of these saved parts are all changed and installed according to the properties of the area.

Yes. I want to create these features. I’m familiar with the datastore features, but I have no idea how to relocate the parts to the properties of the zone. Help!

When you say “installed according to the properties of the area” are you implying the rotation of the grey part, what properties are you looking for?

I’d probably just weld all the parts in-place on the grey part, rotate/move the grey part (moving everything with it) then unweld everything once placed.

1 Like

Hi . Let me break the steps down for you .
1)Get a pivot point for each plot(top left corner maybe???)
2)when saving the object in the plot, do not save the world position. Instead take the position of the object subtract my the position of the pivot point
3)when loading, take the position of the pivot point + the offset( aka the value on step 2)

there majik . But if your plot have diffent rotation, you can do the same but instead of position, it should be orientation

1 Like

You could use ToObjectSpace(Current zone the parts are on’s CFrame) to get the position of each part relative to a zone, then you could simply multiply the CFrame of the zone you want to move the part to by the CFrame that you got from using ToObjectSpace and it should work correctly.

For example, let’s say I’m trying to move part B from part A to part C. I could use this:

local A = workspace.A
local B = workspace.B
local C = workspace.C

B.CFrame = C.CFrame * B.CFrame:ToObjectSpace(A.CFrame)

Heres the result of said code above:

1 Like

I just did a quick test.

I made four parts. fl1, fl2, fl3, and mv,
and tested them.

This is the code.

local fl1 = workspace.fl1
local fl2 = workspace.fl2
local fl3 = workspace.fl3
local mv =

mv.CFrame = fl1.CFrame * mv.CFrame:ToObjectSpace(fl3.CFrame)

스크린샷 2024-06-22 004827
But when I ran it, the mv part was moved to a remote location.
Can you tell me what I missed?

local PlateA = workspace.PlateA
local PlateB = workspace.PlateB
local PlateC = workspace.PlateC
local MovePart = workspace.MovePart

MovePart.CFrame = PlateC.CFrame * PlateA.CFrame:ToObjectSpace(MovePart.CFrame)

I solved it. I should have read the manual carefully.

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