Essentially just what the title says. I want to assign a rotation to my camera’s CFrame without modifying the position alongside it so that the player can still pan the camera around while it’s rotating. I have tried using CFrame.Angles(math.rad())
inside my RenderStepped loop, but that still edits the position with it (and therefore prevents the camera from being panned around).
I’m honestly just stumped here, and any help is greatly appreciated.
1 Like
You can use something like this:
cam.CFrame = CFrame.new(cam.CFrame.Position) * CFrame.Angles(math.rad(xrot), math.rad(yrot), math.rad(zrot))
Alright, this somewhat works. Would there be a way to assign only 1 of those rotations instead of all 3 at once?
You can just set the others to 0 without using math.rad
Maybe you can try adding the rotation first and then do the position after. Like this
CFrame = NewCFrame * CFrame.Angles(_, _, _)
CFrame.Position = NewCFrame.Position
This would be a good idea, but CFrame.Position is read only, so it’ll just give the same old “Position can’t be assigned to”.
Try this then
Position = NewCFrame.Position