Answered by
5 years ago Edited 5 years ago
1 | local model = script.Parent |
2 | local player = game.Players:WaitForChild( "BuDeep" ).CharacterAdded:Wait() |
5 | x, y, z, m 11 , m 12 , m 13 , m 21 , m 22 , m 23 , m 31 , m 32 , m 33 = CFrame.new(model.PrimaryPart.Position, player.HumanoidRootPart.Position):GetComponents() |
6 | model:SetPrimaryPartCFrame(CFrame.new(x, y, z, m 11 ,m 12 ,m 13 ,m 21 , 90 ,m 23 ,m 31 , 0 ,m 33 ) * CFrame.Angles( 0 , 0 ,math.pi/ 2 )) |
The above should work, the x axis will be off by about 0.05 increments though (not noticeable at all). I gotta go to work but later on today I may try and fix that issue.
What I think happened is your cframe values were creating their own rotations for the part, and thus ignoring the multiplied cframe angle value. I manually got the components of the cframe and changed a couple of the upvector values to a 0 and a 90.
I'll try and post a better explanation tonight, let me know if you have issues!