Changing rotation according to mouse with a model

So, I know that you can change the rotation of a part like this:

Part.CFrame = CFrame.new((Char.HumanoidRootPart.CFrame * CFrame.new(0, 0, 5)).Position, Mouse.Position) * CFrame.Angles(0, math.rad(0), 0)

But, how do I change the rotation of an entire model? I tried this:

Model:SetPrimaryPartCFrame((Char.HumanoidRootPart.CFrame * CFrame.new(0, 0, 5)).Position, Mouse.Position) * CFrame.Angles(0, math.rad(0), 165)

But it didn’t really seem to work…
I would like help with this subject as I have no idea what’s the problem.

Make sure that the model is anchored or at least the HumanoidRootPart.

It is anchored already, don’t think the problem is anything like that.

Just to be sure, you are trying to rotate the model in the direction of the mouse?

Yeah, I am trying to do that, although I don’t know how to do it with a model.

Can you give me a little more information. Like is there any errors?

Yeah, it errors “expected indentifier” on that, that’s the only thing there is to it

You’re code was a little bit off, I’ve fixed it up a bit. Let me know if this works or not.

Model:SetPrimaryPartCFrame(CFrame.new((Char.HumanoidRootPart.CFrame * CFrame.new(0, 0, 5)).Position, Mouse.Position) * CFrame.Angles(0, math.rad(0), 165))
1 Like