[PLEASE HELP] Tweening camera makes it rotate weirdly

I tweened the camera to a part in my game and it’s rotated the camera weirdly, so now instead of looking straight down to the part like its supposed to, its looking at the part from the side?

code: (local script in starter character scripts)

local camera = game.Workspace.CurrentCamera
local event = game.ReplicatedStorage.Events.SpiritBoardCamera
local TweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local cutsceneModel = game.Workspace:WaitForChild("SpiritBoardCutscene")

event.OnClientEvent:Connect(function(board, camPart, pointer, boardPos, camPos, pointerPos, num)
	camera.CameraType = Enum.CameraType.Scriptable
	local tweeninfo = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
	local cutsceneBoardPos = cutsceneModel.Board.Position
	local cutsceneCamPos = cutsceneModel.Board.cameraPart.Position
	local cutscenePointerPos = cutsceneModel.Pointer.MeshPart.Position
	
	camera.CameraSubject = player.Character.Head
	TweenService:Create(camera, tweeninfo, {CFrame = CFrame.new(game.Workspace:WaitForChild(player.Name.."SpiritBoard").Board.cameraPart.Position, game.Workspace:WaitForChild(player.Name.."SpiritBoard").Board.Position)}):Play()
	if (num == 1) then
		print("ghost not summoned")
	else
		print("summoned ghost")
		TweenService:Create(camera, tweeninfo, {CFrame = CFrame.new(game.Workspace:WaitForChild(player.Name.."SpiritBoard").Board.cameraPart.Position, game.Workspace:WaitForChild(player.Name.."SpiritBoard").Board.Position)}):Play()
		task.wait(0.75)
		TweenService:Create(game.Lighting.SpellColour, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {TintColor = Color3.fromRGB(0,0,0)}):Play()
		task.wait(1.2)
		TweenService:Create(camera, tweeninfo, {CFrame = CFrame.new(cutsceneCamPos, cutsceneBoardPos)}):Play()
		wait(1.95)
		TweenService:Create(game.Lighting.SpellColour, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {TintColor = Color3.fromRGB(255,255,255)}):Play()
		print("starting pointer movement")
	end

	camera.CameraSubject = player.Character.Humanoid
	camera.CameraType = Enum.CameraType.Custom
end)

screenshots:

what its supposed to look like:
image

what it actually looks like:
image

3 Likes

can anyone help with this please?

1 Like

multiply the final CFrame position with a CFrame.Angle(math.rad(90), 0, 0). Not sure if its the X axis but its one of those

1 Like

If you really really couldn’t solve it, you could just make a invisible, Non-collision part welding to the part you want the camera to attach to. (or you just anchor it if it won’t move at all).

Then you can just tween the Camera’s CFrame to that part’s CFrame.

If the camera points to the incorrect direction then just rotate that invisible part you made earlier.

3 Likes

I tried this and I couldn’t get it to work, it just kept erroring saying “attempt to call a nil value”

sorry for the very late reply

1 Like

This is what I’m doing already. I’ve tried making the camera look a certain way from the part but I can’t figure out how, and even when I’ve tried rotating it and things it hasn’t worked.

sorry for the very late reply

1 Like