How can I rotate a CFrame without changing it's position?

Very simple question, I just need to know how I can rotate the cframe (of the camera) without changing the camera’s position. Using cframe.angles() like on the Cframes documentation (CFrames | Documentation - Roblox Creator Hub) just resets the cframe position then rotates it. Please help!

3 Likes

What code have you tried already?

Just the CFrame.angles() technique. I’m not really sure what else to try as searching it up on google reveals no results…

1 Like
local part = YourPart
part.CFrame = CFrame.new(part.Position, PositionToLookAt)

I just need to set the x,y,z components of the cframe, I don’t need it looking at another part

local part = YourPart
part.CFrame = CFrame.new(part.Position, Vector3.new(x, y, z))

I don’t need the cframe to LOOK at a position, I need it to change THIS property:
image
Of the CFrame.

Is this classified info or something lol

1 Like
local camera = workspace.CurrentCamera

camera.CFrame = camera.CFrame * CFrame.Angles()

In a way it would change the Orientation. But yeah, what @JohhnyLegoKing said is right too. Do not forget to use math.rad() with CFrame.Angles() like this:

CFrame.Angles(math.rad(x), math.rad(x), math.rad(x))

Excepted if you want to use the radiant angles

2 Likes

I eventually found out you need to multiply the position of the CFrame by the orientation you want. (also I didn’t mean to reply to Boustifail in the post above, so I deleted it) Sorry everyone!

1 Like

Hey!
I don’t know if you fixed your issue, but here is the solution:

workspace.CurrentCamera.CFrame = CFrame.fromOrientation(0,0,0)
2 Likes

As I said, I had already solved the problem but your solution is very similar to what I did. Thanks for the help :)‎

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.