So I have no idea what to do nor can I find a thread that can help.
Model:SetPrimaryPartCFrame(CFrame.Angles(workspace.ZEP2.Spawners:FindFirstChild(“1”).Orientation))
So I have no idea what to do nor can I find a thread that can help.
Model:SetPrimaryPartCFrame(CFrame.Angles(workspace.ZEP2.Spawners:FindFirstChild(“1”).Orientation))
A CFrame
contains basically 2 parts; The directional part, and the positional part. You can remove one from the other. For example, say you have 2 parts, and you want the second one to face the same way, you could do:
local firstPart = --Define
local secondPart = --Define
local firstPartCF = firstPart.CFrame --The first part's CFrame
local firstPartAngleCF = firstPartCF-firstPartCF.p --The first part's CFrame without the position (Or a position of {0,0,0})
secondPart.CFrame = firstPartAngleCF + secondPart.CFrame.p --We set the CFrame to the angle of the first part and the position of the second.
Note, this assumes that the position for the Model is already set, and you just want it to face the same way
local firstPart = workspace.ZEP2.Spawners:FindFirstChild(“1”)
local firstPartCF = firstPart.CFrame --The first part's CFrame
local firstPartAngleCF = firstPartCF-firstPartCF.p --The first part's CFrame without the position (Or a position of {0,0,0})
local secondPartPosition = Model.PrimaryPart.CFrame.p
Model:SetPrimaryPartCFrame(firstPartAngleCF + secondPartPosition) --We set the CFrame to the angle of the first part and the position of the second.
If you have more questions related to CFrames, feel free to ask.
aaaaaaaaa
It worked! Sorry if I seemed like I was trying to get you to do all the work. CFrame with models is kinda hard for me lol. Thanks for teaching me
No, I didn’t do all the work. CFrames are complicated as heck. Just remember, if you subtract the position of a CFrame, you then just have a angle you can add to a position.
I recommend this resource as it really helps with understanding CFrames.
I’m glad I could help, there’s a lot of better resources on the DevFourm that most likely explain it better than me. Feel free to ask more questions about CFrames if you want.