Advertisement
OEAgamer1

2D Camera Script

Mar 20th, 2024
1,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. local cam = workspace.CurrentCamera
  2.  
  3. local char = script.Parent
  4. local hrp = char:WaitForChild("HumanoidRootPart")
  5.  
  6.  
  7. local cas = game:GetService("ContextActionService")
  8.  
  9. cas:UnbindAction("moveForwardAction")
  10. cas:UnbindAction("moveBackwardAction")
  11.  
  12.  
  13. game:GetService("RunService").RenderStepped:Connect(function()
  14.  
  15.     cam.CameraType = Enum.CameraType.Scriptable
  16.  
  17.     cam.CFrame = cam.CFrame:Lerp(CFrame.new(hrp.Position + Vector3.new(0, 5, 10), hrp.Position), 0.1)
  18. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement