Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to fix this 2d going behind the player instead of on the side?

local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera

player.CharacterAdded:Wait()
player.Character:WaitForChild("HumanoidRootPart")

camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 70



game:GetService('RunService').Stepped:Connect(function()
	 camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0,0,10)
end)

I was making a 2d camera for a platformer game , But i do not know how i can fix my issue. My players 2d camera goes behind the player instead of the side i tried cframing the orientian but this dident work can someone help me out?

1 answer

Play Around With The CFrames !

You Can Change The Position and Rotation Using The CFrame and The CFrame.Angles Method Like This

---Something.CFrame = CFrame.new(0,0,0) * CFrame.Angles( math.rad(0) ,  math.rad(0)  ,  math.rad(0) )

This discussion is preserved as it was. New answers, comments, and votes are closed.