Run it
Copy the script and paste it into your executor.
cam = .CurrentCamera
UIS = :()
RS = :()
onMobile = UIS.KeyboardEnabled
keysDown = {}
rotating =
:() .Loaded:()
cam.CameraType = .CameraType.Scriptable
speed =
sens =
speed /=
onMobile sens*=
()
rotating
delta = UIS:()
cf = cam.CFrame
yAngle = cf:(.RotationOrder.YZX)
newAmount = .(yAngle)+delta.Y
newAmount > newAmount < -
(yAngle< delta.Y<) (yAngle> delta.Y>)
delta = .(delta.X,)
cf *= .(-.(delta.Y),,)
cf = .(,-.(delta.X),) * (cf - cf.Position) + cf.Position
cf = .(cf.Position, cf.Position + cf.LookVector)
delta ~= .(,) cam.CFrame = cam.CFrame:(cf,sens)
UIS.MouseBehavior = .MouseBehavior.LockCurrentPosition
UIS.MouseBehavior = .MouseBehavior.Default
keysDown[]
cam.CFrame *= .(.(,,-speed))
keysDown[]
cam.CFrame *= .(.(-speed,,))
keysDown[]
cam.CFrame *= .(.(,,speed))
keysDown[]
cam.CFrame *= .(.(speed,,))
RS.RenderStepped:(renderStepped)
validKeys = {,,,}
UIS.InputBegan:((Input)
i, key (validKeys)
key == (Input.KeyCode)
keysDown[key] =
Input.UserInputType == .UserInputType.MouseButton2 (Input.UserInputType == .UserInputType.Touch UIS:().X>(cam.ViewportSize.X/))
rotating =
Input.UserInputType == .UserInputType.Touch
Input.Position.X < cam.ViewportSize.X/
touchPos = Input.Position
)
UIS.InputEnded:((Input)
key, v (keysDown)
key == (Input.KeyCode)
keysDown[key] =
Input.UserInputType == .UserInputType.MouseButton2 (Input.UserInputType == .UserInputType.Touch UIS:().X>(cam.ViewportSize.X/))
rotating =
Input.UserInputType == .UserInputType.Touch touchPos
Input.Position.X < cam.ViewportSize.X/
touchPos =
keysDown[] =
keysDown[] =
keysDown[] =
keysDown[] =
)
UIS.TouchMoved:((input)
touchPos
input.Position.X < cam.ViewportSize.X/
input.Position.Y < touchPos.Y
keysDown[] =
keysDown[] =
keysDown[] =
keysDown[] =
input.Position.X < (touchPos.X-)
keysDown[] =
keysDown[] =
input.Position.X > (touchPos.X+)
keysDown[] =
keysDown[] =
keysDown[] =
keysDown[] =
)