Setting the Player’s Camera to a Part’s Perspective
So I just want to make a simple cutscene and change the player’s view to a part’s view. The only problem is that the camera is facing in the wrong direction. Here is the module script:
local module = {}
local rig = game.Workspace:WaitForChild("Rig")
local rigPrim = rig:WaitForChild("HumanoidRootPart")
local mainFrame = rigPrim.CFrame
rig:Destroy()
module.FirstCam = function(plr: Player,camera,targetPart: Part) -- camera function
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
hum.WalkSpeed = 0
hum.JumpPower = 0
hrp.Anchored = true
hrp.CFrame = mainFrame
camera.CameraType = Enum.CameraType.Fixed
camera.Focus = targetPart.CFrame -- sets the player's camera to that part
end
return module
It’s setting the position of the camera to the part’s position but not the rotation? It doesn’t matter if I change the camera part’s rotation, it just stays the same. All I’m trying to do is get the camera rotation facing in the front direction of the camera part.