If I understand you correctly you want to model rotate to the camera?
If so this should work.
Model:SetPrimaryPartCFrame(
CFrame.new(NewPos, NewPos + Normal) * --no reason to do Normal*15, has the same effect as Normal
CFrame.new(0, Model.PrimaryPart.Size.Y / 2, 0) *
CFrame.Angles(0, 0, math.rad(yRot))
)
(Sorry for no tabs, when I press tab it doesn’t want to place it for some odd reason)
What I’m trying to do is have it so when I move the model it doesn’t rotate, it should stay in its original rotation. and as mentioned in my previous reply, I need NewPos + Normal * 15 otherwise the model goes into the ground
Ok, I was so excited cause that worked, kinda. It fixes the whole rotation glitch, but now when I move the model up along the walls it doesnt rotate on the wall. It just stays upright (which isn’t what I want)
The model should rotate along with the wall, which is what it did when I had this
I think I know what happened, what is the current orientation of the model may I ask?
The starter orientation must be 0,0,0
What I suggest is this: Model:SetPrimaryPartCFrame(ModelPos * ROTATION)
then: Model.PrimaryPart.CFrame = CFrame.new(Model.PrimaryPart.Position)
This way the model is rotated but the hitbox isn’t.
What I mean is, replace your model rotation function with this:
function setCFRotation(R) --NOTE: This *set* the rotation, so calling setCFRotation(45) will won't increase the rotation but set it.
Model:SetPrimaryPartCFrame(CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(R),0)) --rotates the model
Model.PrimaryPart.CFrame = CFrame.new(0,0,0) --resets the primarypart cf
end
Then use the movement code I’ve sent,
Once all of that is don’t should work.
The problem I see with your place tho is since your part is just a cube you can’t actually tell if the parts being rotated weirdly. Plus there’s no rotation
function rotateCF()
Model:SetPrimaryPartCFrame(CFrame.new(0,0,0)*CFrame.Angles(0,.707,0))
Model.PrimaryPart.CFrame = CFrame.new(0,0,0)
end
If you call that if will rotate by 45 degrees.
Or replace it with this:
function rotateCF(R)
Model:SetPrimaryPartCFrame(CFrame.new(0,0,0)*CFrame.Angles(0,R,0))
Model.PrimaryPart.CFrame = CFrame.new(0,0,0)
end
rotateCF(math.deg(45))