Advertisement
Hasli4

RBLX. CameraScript

May 15th, 2025
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local RunService = game:GetService("RunService")   
  2.  
  3. local camera = workspace.CurrentCamera
  4. local player = game.Players.LocalPlayer
  5. local CAMERA_OFFSET = Vector3.new(-1, 60, 0)
  6. camera.CameraType = Enum.CameraType.Scriptable
  7.  
  8. local function onRenderStep()
  9.     if player.Character then
  10.         local playerPosition = player.Character.HumanoidRootPart.Position
  11.         local cameraPosition = playerPosition + CAMERA_OFFSET
  12.         camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
  13.     end
  14. end
  15. RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement