print(bodyCF:vectorToWorldSpace(Vector3.new(0,1,0))) --(0,1,0) print(mainBody.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))) --(0,1,0) mainBody.CFrame=bodyCF print(mainBody.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))) --(~0,-1,~0)
So neither the part nor the desired CFrame are upside down, but after assignment, somehow the part is upside down.
Details:
-Part is a UnionOperation, welded together with a bunch of other parts (its a model)
-What I do:
- Model is cloned and parented to workspace from serverstorage
- Model is welded manually by creating Weld, setting params, parenting in jointsservice (each part welded to mainBody)
- I try to set CFrame but as shown, it doesnt work too well…
-Everything is unanchored
bodyCF is calculated as follows:
local bodyOrientation = CFrame.Angles(0,math.pi / 2,0) local arrivalPos = ... (a valid Vector3, I checked) local bodyCF=(CFrame.new(Vector3.new(0,0,0),((somePart.Position - arrivalPos)*Vector3.new(1,0,1)).unit) * bodyOrientation) + arrivalPos
And I dont see anything that would cause the values to become invalid somehow (somePart.Position is not equal or even remotely close to arrivalPos)
I tried to reproduce with a simple model of two parts (even with one being single-part unionoperation), but was unable to.
I have same issue with another model in my place, which works basically the same way.