#Camera scripting help

6 messages · Page 1 of 1 (latest)

ocean pike
#

How do i get the clients camera to pivot around a cframe? like a third person camera, but the pivot is only around the cframe

split salmon
#

create a script and add it to the camera

#
local pivot = CFrame.new(0, 5, 10)
local input = game:GetService("UserInputService")
local camera = game.Workspace.CurrentCamera

while true do
  local mouseDelta = input:GetMouseDelta()
  camera.CFrame = pivot * CFrame.Angles(0, -mouseDelta.X * 0.01, 0)
  wait()
end
#

This sets the pivot point to a CFrame with the position (0,5,10) and makes the camera rotate around that point based on the player's mouse movement.

solar sapphire
#

yea