So I’m developing a plot loading system and im using :ToWorldSpace() and :ToObjectSpace() to load plots into separate locations, however, I am struggling to understand how to grab the Y rotation of a furniture item from its Primary Part CFrame while also using ObjectSpace
I have tried:
local y = cframe:ToObjectSpace(CFrame.new(v:GetPrimaryPartCFrame().p)).Rotation.Y
cframe is just the house plot and that doesn’t have anything to do with my problem
This line of code will just return 0 everytime and load in the plot with every furniture facing the same way at Y rotation 0
Sorry, can you take a step back? What exactly are you trying to do?
If you’re storing the object-space CFrame of the furniture, and converting it back to world-space when you load, what’s the problem? The CFrame should contain the position and rotation info.
If you just need a way to store CFrames, you can do that:
You can optimize that if you need to by converting to a quaternion sending the smallest three components as described here in “Optimizing Orientation”. But it’s twelve numbers without that so I wouldn’t bother.