of     1   

Hedr0n
#183481827Saturday, February 13, 2016 4:09 AM GMT

local ReplicatedStorage = game:GetService('ReplicatedStorage') local Player = game:GetService('Players').LocalPlayer local Camera = game.Workspace.CurrentCamera local Mouse = Player:GetMouse() local Target = game.Workspace:WaitForChild('Part') local LastMousePos = Mouse.X local Holding = false local DeltaMouse = 0 local Damping = 0.5 local TransferingState = false local CurrentState = 'Default' local ZoomStates = { ['Default'] = CFrame.new(5, 5, 10) } Camera.CameraType = Enum.CameraType.Scriptable Camera.CameraSubject = Target function MoveStates(State, Speed) local Speed = Speed or 0.1 TransferingState = true CurrentState = 'Lerp' for Index = 1, 20 do ZoomStates[CurrentState] = ZoomStates[CurrentState]:lerp(ZoomStates[State], Speed/20) wait() end TransferingState = false CurrentState = State end local function RightChanged(actionName, actionInputState, actionInputObject) if actionInputState == Enum.UserInputState.End then Holding = false elseif actionInputState == Enum.UserInputState.Begin then Holding = true end end local function GetDeltaMouseSpeed() local DeltaMouseRecorder = coroutine.create(function() while wait() do DeltaMouse = LastMousePos - Mouse.X LastMousePos = Mouse.X end end) coroutine.resume(DeltaMouseRecorder) end local function CameraHandle() GetDeltaMouseSpeed() spawn(function() local Index = 200 while wait() do if not Holding then Index = Index + math.rad(Damping) Camera.CoordinateFrame = CFrame.new(Target.Position) * CFrame.Angles(0, Index, 0) * ZoomStates[CurrentState] * CFrame.Angles(math.rad(-20), 0, 0) else local NewAngle = Index + (DeltaMouse * 0.005) Index = NewAngle Camera.CoordinateFrame = CFrame.new(Target.Position) * CFrame.Angles(0, NewAngle, 0) * ZoomStates[CurrentState] * CFrame.Angles(math.rad(-20), 0, 0) end end end) end game:GetService("ContextActionService"):BindAction("RightChanged", RightChanged, false, Enum.UserInputType.MouseButton2) CameraHandle() #code while wait(1) and x > madness do x = x - 0.01 end
SwagCuzYolo
#183482518Saturday, February 13, 2016 4:19 AM GMT

The main problem I see is that your screen size is small af
JarodOfOrbiter
#183482794Saturday, February 13, 2016 4:24 AM GMT

I'll never understand expressions like that. It's like "Your screen size is as small as yellow", or "Your screen size is as small as aromatic". How does it even make sense? Never green that yesterday, tofu sometimes doesn't matter together with hair. Fish just smells upwards. (Never mind that, it actually doesn't matter I guess. Slang is just weird.)
Hedr0n
#183528887Saturday, February 13, 2016 8:37 PM GMT

Here is a much better revision of that same code posted in op local ContextService = game:GetService("ContextActionService") local RunService = game:GetService('RunService') local Player = game:GetService('Players').LocalPlayer local Camera = workspace.CurrentCamera local Mouse = Player:GetMouse() Camera.CameraType = 'Scriptable' local Target = workspace:WaitForChild('Part') local RightHolding = false local Dampining = 0.01 local Direction = 1 local Index = 0 local function RightChanged(ActionName, ActionInputState, ActionInputObject) if ActionInputState == Enum.UserInputState.End then RightHolding = false elseif ActionInputState == Enum.UserInputState.Begin then RightHolding = true end end local DeltaMouse = 0 local LastMouse = 0 RunService.RenderStepped:connect(function() local OldIndex = Index DeltaMouse = LastMouse - Mouse.X LastMouse = Mouse.X if RightHolding then Index = Index + (DeltaMouse * 0.005) Camera.CFrame = CFrame.new(Target.Position) * CFrame.Angles(0, Index, 0) * CFrame.new(0, 2.5, 4.5) * CFrame.Angles(math.rad(-20), 0, 0) else Index = Index + (Dampining * Direction) Camera.CFrame = CFrame.new(Target.Position) * CFrame.Angles(0, Index, 0) * CFrame.new(0, 2.5, 4.5) * CFrame.Angles(math.rad(-20), 0, 0) end if Index > OldIndex then Direction = 1 elseif Index < OldIndex then Direction = -1 end end) ContextService:BindAction("RightChanged", RightChanged, false, Enum.UserInputType.MouseButton2) smite me down god

    of     1