You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want the angle of the camera to tilt up and down depending on the angle of the hand position, so more simply, the camera tilts up and down depending on an angle -
What is the issue? Include screenshots / videos if possible!
I managed to do what I want, but only when facing in one direction. When I turn 90 degrees it ends up just rolling the camera, and turning 180 degrees around makes it do the opposite of what I want -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I haven’t really been able to find any solutions, I originally thought it was a problem with the attachment that is locked to the player but I later realised that the Z axis of the camera was changing for some reason, I then tried to set the Z orientation of the camera to zero but it still changes from zero?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
The camera is set to scriptable and these lines of code run every frame.
local x,y,z = game.Players.LocalPlayer.Character:WaitForChild("RightHand").RightWrist.C0:ToOrientation()
local cameraGoal = {CFrame = CFrame.new(cameraAttachment.WorldPosition)*CFrame.Angles(math.rad(cameraAttachment.WorldOrientation.X)+x,math.rad(cameraAttachment.WorldOrientation.Y),0)}
local cameraTweenInfo = TweenInfo.new(0.1)
local cameraTween = TS:Create(workspace.CurrentCamera,cameraTweenInfo,cameraGoal)
cameraTween:Play()
Im looking for a reason why the Z axis seems to be changing even though it should be set to 0.