Need help, camera question

HEYO!
Ok, so here’s my question.

In Zelda, Ocarina of time you can push R to reset the players camera to wherever the player is facing.

How would I accomplish this? I’m confused.

thanks!

Just set the camera CFrame to the players head look vector, and if you want it to be a smooth transition over to that spot lerp the camera.

this is what I have:

camera.CFrame = CFrame.new(char.Head.CFrame.LookVector)

Is anything wrong with it?
(Thank you for helping)

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local char = player.Character or player.CharacterAdded:Wait()

mouse.KeyDown:Connect(function(key)
	key:lower()
	if key == "r" then
		local camera = game.Workspace.CurrentCamera
		camera.CFrame = CFrame.new(char.Head.CFrame.LookVector)
	end
end)

Then you can use lerp to make it more smooth also you can change how you use it

uhh here:

--// Place this inside StarterPlayer > StarterCharacterScripts
local uis = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
repeat wait()
    camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable

uis.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.R then
        local ti = TweenInfo.new(1) --// Change 1 to the animation time
        game:GetService("TweenService"):Create(camera, ti, {CFrame = script.Parent:WaitForChild("Head").CFrame.LookVector}):Play()
    end
end)

This wouldn’t be necessary since you don’t want the camera to be focusing on the player correctly.

lol I was writing this while @ScriptedPoptartz was writing, but his version is also very good and I do suggest his

Also if you are going to use this way I would also add at the end

camera.CameraType = Enum.CameraType.Custom

So then it focuses the player once more but the thing about his is if you move the player you camera wouldn’t be following.

lol yeah I forgot that, sorry.

Here’s what’s happening for me:
https://gyazo.com/db2f0a1d996891a82ec2ae472ce15165

Here’s my code:

local function ResetCamera(mode)
if mode == "on" then
	BlackBars("set_on")
	local camera = game.Workspace.CurrentCamera
	camera.CFrame = CFrame.new(char.Head.CFrame.LookVector)
elseif mode == "off" then
	BlackBars("set_off")
	camera.CameraType = Enum.CameraType.Follow
end
end

Thanks!
EDIT: I’m not the best with Camera work, sorry xD

It works fine for me, at the end just dont change the cameratype.

I took it out, it’s still doing it for some odd reason…

Here is proof that it works for me
https://gyazo.com/7385970fb337789eaf401c78791f6f5e

Okay, I’ll try some things out, thank you Pop!

OHHH I KNOW THE ISSUE, Its because the head model your using the back of the head is there. It looks at the back so just rotate the characters head to the right way.

Something even weirder…
I tested the full script, didn’t work. Doing the same thing.
I tested it without the link character, didn’t work. Doing the same thing.

Is there can extra setting I should change?
EDIT: Just tried with r15, didn’t work right.

I have no clue why it doesent work for you. I would just make sure the custom chaarcters head is facing the right direction as well as have the local script in Starter Gui.

Yeah, it’s being weird. Thank you so much for the help though! I’ll use this and figure it out! : )

Heres the place you can edit

Wait a sec, it’s doing it for me here too. Are we both talking about the same thing? lol.