Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lockCamera = false
- distance = 30
- height = 5
- local torso = script.Parent.Torso
- local center = Instance.new("Part")
- center.Name = script.Parent.Name .. " Center"
- center.Transparency = 1
- center.CanCollide = false
- center.Size = Vector3.new(1,1,1)
- center.Position = torso.Position
- center.CFrame = CFrame.new(Vector3.new(0,0,0),Vector3.new(0,0,-1))
- center.Parent = game.Workspace
- local bp = Instance.new("BodyPosition")
- bp.position = center.Position
- bp.maxForce = Vector3.new(1000000, 1000000, 1000000)
- bp.Parent = center
- local bg = Instance.new("BodyGyro")
- bg.maxTorque = Vector3.new(9e+005, 9e+005, 9e+005)
- bg.cframe = center.CFrame
- bg.Parent = center
- local cam = game.Workspace.CurrentCamera
- cam.CameraSubject = center
- cam.CameraType = Enum.CameraType.Attach
- while torso.Parent do
- wait()
- center.BodyPosition.position = torso.Position
- if lockCamera then
- cam.CoordinateFrame = CFrame.new(Vector3.new(center.Position.x + distance,center.Position.y + height,center.Position.z))
- end
- end
- center:Remove()
Advertisement
Add Comment
Please, Sign In to add comment