Problem with look vector

Hey,
So pretty much I am having a problem with the direction of the camera after my players does a rolling animation. The camera will move back to the spot it started in before the animation. I want the camera to be in the middle of the screen at the end of the animation.

robloxapp-20230703-1744571.wmv (903.8 KB)

rollAnimTrack:Play()
			script.Roll:Play()
			
			plr.Character:SetAttribute("Rolling",true)
			print("Rolling")
			
			wait(0.8)
			campos = game.Workspace.CurrentCamera.CFrame

			print("Hi")
			
			rollAnimTrack.Ended:Once(function()
				
				print(workspace.CurrentCamera.CFrame)

				plr.Character:SetAttribute("Rolling",false)
				print("Rolling stopped")
				
				print(workspace.CurrentCamera.CFrame)
				
				
				local prevCam = workspace.CurrentCamera.CameraType
				
				workspace.CurrentCamera.CameraType = Enum.CameraType.Fixed
				
				wait()
				
				game.Workspace.CurrentCamera.CFrame.LookVector = CFrame.new(plr.Character.HumanoidRootPart.CFrame.LookVector.X, 0, plr.Character.HumanoidRootPart.CFrame.LookVector.Z)    ---- having problem here

				wait()

Comes up with error that says look vector cannot be assigned.
Any help will be appreciated

2 Likes

I dont exactly understand but have you tried changing

game.Workspace.CurrentCamera.CFrame.LookVector = CFrame.new(plr.Character.HumanoidRootPart.CFrame.LookVector.X, 0, plr.Character.HumanoidRootPart.CFrame.LookVector.Z)    ---- having problem here

to

game.Workspace.CurrentCamera.CFrame = CFrame.new(plr.Character.HumanoidRootPart.CFrame.LookVector.X, 0, plr.Character.HumanoidRootPart.CFrame.LookVector.Z)    ---- having problem here

yeh I have tried that. So pretty much I just want to move where the camera is facing to straight forward of the character. Just doing .CFrame doesnt change where it is looking. Thats what I found out atleast.