Hey, so yeah basically the title says pretty much all
Heres a video of the problem
Code
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local camera = workspace.CurrentCamera
local IsoCamPart : Part = workspace.Cam
camera.CameraType = Enum.CameraType.Scriptable
camera.FieldOfView = 5
camera.CFrame = IsoCamPart.CFrame
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local dragOrigin
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessedEvent then return end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
dragOrigin = mouse.Hit.Position
end
end)
game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
if UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton2) then
local difference = (dragOrigin - mouse.Hit.Position)
local tween = TweenService:Create(camera, TweenInfo.new(.35), {CFrame = camera.CFrame + difference})
tween:Play()
end
end)
