Sungmingamerpro13

Camera style NES Super mario bros

Aug 31st, 2026
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.14 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3.  
  4. local player = Players.LocalPlayer
  5. local camera = workspace.CurrentCamera
  6.  
  7. -- CONFIGURACIÓN
  8. local CAMERA_HEIGHT = 6
  9. local CAMERA_DISTANCE = 30
  10.  
  11. -- Esperar personaje
  12. local character = player.Character or player.CharacterAdded:Wait()
  13. local root = character:WaitForChild("HumanoidRootPart")
  14.  
  15. camera.CameraType = Enum.CameraType.Scriptable
  16.  
  17. RunService.RenderStepped:Connect(function()
  18.     if not character or not character.Parent then
  19.         return
  20.     end
  21.  
  22.     root = character:FindFirstChild("HumanoidRootPart")
  23.     if not root then
  24.         return
  25.     end
  26.  
  27.     -- Posición de la cámara
  28.     local cameraPosition = Vector3.new(
  29.         root.Position.X,
  30.         root.Position.Y + CAMERA_HEIGHT,
  31.         root.Position.Z + CAMERA_DISTANCE
  32.     )
  33.  
  34.     -- Mirar al jugador
  35.     local targetPosition = Vector3.new(
  36.         root.Position.X,
  37.         root.Position.Y + CAMERA_HEIGHT,
  38.         root.Position.Z
  39.     )
  40.  
  41.     camera.CFrame = CFrame.lookAt(cameraPosition, targetPosition)
  42. end)
  43.  
  44. player.CharacterAdded:Connect(function(newCharacter)
  45.     character = newCharacter
  46.     root = character:WaitForChild("HumanoidRootPart")
  47. end)
  48.  
Advertisement
Add Comment
Please, Sign In to add comment