I am trying to rotate my camera part clockwise by 22.5 degrees but it is being rotated anticlockwise by X (unsure amount), when changing the value to say 245 the camera still rotates to X, I am unsure why.
--//Services
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
--//Variables
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local HumRoot = Character:WaitForChild("HumanoidRootPart")
local currentCamera = workspace.CurrentCamera
local menuCam = workspace.Lobby.CameraPart
local menuCameraDefaultLocation = CFrame.new(Vector3.new(95, 7, -14),Vector3.new(0, math.rad(90), 0))
local menuCameraDeployWaitLocation = CFrame.new(Vector3.new(58, 7, -14),Vector3.new(0, math.rad(22.5), 0)) --22.5
local DeployButton = LocalPlayer.PlayerGui.LobbyUi.Lobby.Deploy
--//TweenService Variables
local DeployGoal = {}
DeployGoal.CFrame = menuCameraDeployWaitLocation
local tweenInfo = TweenInfo.new(5)
local mainMenuToDeployWaitTween = TweenService:Create(menuCam, tweenInfo, DeployGoal)
--//Controls
local CamStep = true
--//Functions
currentCamera.CameraType = Enum.CameraType.Scriptable
game:GetService("RunService").RenderStepped:Connect(function(deltatime)
if CamStep == true then
currentCamera.CFrame = menuCam.CFrame
else return end
end)
local function Deploy()
mainMenuToDeployWaitTween:Play()
print("fired")
end
--//Firing
DeployButton.MouseButton1Click:Connect(Deploy)```