Rotation relative to part

How would I rotate a part 90 degrees relative to another part?

I’m saving parts that then get placed on a plane but the problem is if I rotate the plane the parts don’t rotate with it once the parts are placed again.

I got the CFrame of the parts but translated to the object space of the plane, I get stuck when I have to combine the rotation of parts and the rotation of the plane(s).

Maybe u can do this

part1.Orientation = part2.Orientation + Vector3.new(90,0,0)

or

part1.CFrame = part2.CFrame * CFrame.Angles(math.rad(90),0,0)

or u can just weld the parts to the primary part and they will get auto rotated relative to it

No that didn’t work, I also go some weird behavior, some of the parts went into the ground and then they went to 0,0,0…

You could use a part’s lookVector/rightVector to rotate another part relative to it.

Can’t you just use ToWorldSpace to fix that?

So I got progress, but some weird behavior, values goes from being negative to positive, so one time it may be at the correct place but after a reload it changes place, same values only some are now negative, and after a reload they go back to normal. I could fix it by multiplying the values by -1 but that creates a problem where if you rotate the part it now doesn’t work due to the multiplication…

I found out the issue, when using ToObjectSpace when saving the part data, I did it in the wrong order so the plot was relative to the part instead of the part being relative to the plot, I also overcomplicated things, when I just had to use ToObjectSpace and ToWorldSpace!