I need help trying to do this: (Click for more information)

My current issue was this: How to "enable" the < > to rotate your camera? - #2 by TheCarbyneUniverse

Basically i have made this code:

local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer

UIS.InputBegan:Connect(function(Input)
	print(plr.Name)
	if Input.KeyCode == Enum.KeyCode.Period then
		print("Pressed2")
		local char = plr.Character or plr.CharacterAdded:Wait()
	elseif Input.KeyCode == Enum.KeyCode.Comma then
		print("Pressed")
		local char = plr.Character or plr.CharacterAdded:Wait()
		char:SetPrimaryPartCFrame(char.HumanoidRootPart.CFrame + CFrame.Angles(0,math.rad(-45),0)) --The line that errors.
	end
end)

Its an LocalScript in StarterPlayerScripts.

The issue is that when i press the ( , ) it just gives me an error: Players.PhoenixRessusection.PlayerScripts.LocalScript:12: bad argument #2 (Vector3 expected, got CFrame)
Yes, i think i know the issue, but how would i even do it without using + CFrame?

Sorry if this is badly explained…

Solution:

Have you tried multiplying the CFrame by CFrame.Angles instead of adding them together?

1 Like

Alright! It is working just fine!

1 Like