Basically what I am trying to do Is now that I have gotten rid of HumanoidController and I decided to start my own HumanoidController" but I do not know if it is possible to use Cframe when key == 'w' so that once the player does this it will move you forward in the camera direction using Cframe. I think this is possible but I do not know for sure. :/
Hope there is some explanation to this.
repeat wait(1/60) until game.Players.LocalPlayer.Character and
game.Workspace.CurrentCamera
repeat wait(1/60) until game.Players.LocalPlayer.Character:FindFirstChild("Torso")
local Camera = game.Workspace.CurrentCamera
local Torso = game.Players.LocalPlayer.Character.Torso
Camera.CameraType = "Scriptable"
Camera.CameraSubject = nil
repeat wait() until game.Players.LocalPlayer:FindFirstChild("PlayerGui")
local Player = game.Players.LocalPlayer
local size = Instance.new("ScreenGui", Player.PlayerGui)
size.Name = "Size"
local TMaxHeight = 40
local TMinHeight = 10
local TStep = 2.5
local THeight = 20
local Keys = {}
local Mouse = Player:GetMouse()
local mouse = Mouse
local dir = 180
local MI = 0
local Keys = {}
local Locked = false
local MouseTrack = false
function GetRotation(Unit)
--// Cosine in radian circle: y/x so angle alpha is cos-1(y/x) x=1
--// Problem here is the circle itself as they have 2 solutions.
local AbZ, AbX = math.abs(Unit.z), math.abs(Unit.x)
local Real = math.atan(AbX/AbZ)
--// ^ugly, super, super, ugly...
--// Now find the quadrant
local Plus = 0
--// Cases are Z and X
if Unit.z >= 0 and Unit.x >= 0 then
--Plus = 0
elseif Unit.z >= 0 and Unit.x < 0 then
Plus = (0.5 * math.pi)
Real = ((math.pi *1.5) - Real)
elseif Unit.z < 0 and Unit.x < 0 then
Plus = math.pi
elseif Unit.z < 0 and Unit.x >= 0 then
Plus = math.pi * 1.5
Real = ((math.pi * 1.5) - Real)
end
return Real + Plus
end
function Update()
if not Button2Down then
if not Locked and not MouseTrack then
elseif MouseTrack then
local Size = Player.PlayerGui.Size.AbsoluteSize.X / 2
local Pos = mouse.X
local Diff = 0
if math.abs(Size - Pos) > Size / 20 then
local this = ((Size - Pos) / (Size))
local mul = (this < 0 and -1) or 1
Diff = math.sqrt(math.abs(this)) * 3 * mul
end
dir = dir + Diff
else
dir = math.deg(GetRotation(Torso.CFrame.lookVector)) - 90
end
end
local rot = math.rad(dir)
local x = -math.cos(rot)
local z = math.sin(rot)
local New = Vector3.new(x,0,z) / 1000
local this = (mouse.hit.p - Torso.Position ).unit
Camera.CoordinateFrame = CFrame.new(Vector3.new(Torso.Position.x + MI, Torso.Position.y + THeight, Torso.Position.z) + New , Torso.Position)
Camera:SetRoll(math.rad(dir))
end
game:GetService("RunService").RenderStepped:connect(function()
Update()
end)
function Zoom(TStep)
THeight = ((THeight + TStep <= TMaxHeight and THeight + TStep >= TMinHeight) and THeight + TStep) or THeight
end
mouse.WheelBackward:connect(function()
Zoom(TStep)
end)
mouse.WheelForward:connect(function() Zoom(-TStep) end)
mouse.KeyDown:connect(function(key)
if key == "i" then
Zoom(-TStep)
end
if key == "o" then
Zoom(TStep)
end
if key == "d" then
dir = dir + 1
end
if key == "a" then
dir = dir - 1
end
end)
mouse.KeyUp:connect(function(key)
Keys[key] = false
end)

3 comments
Use the lookVector CFrame constructor of the CurrentCamera's CoordinateFrame Property.
Sorry i'm kinda new to coding so I need a bigger explanation?
Can't you use the Move method of the Humanoid to do what you're doing? http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Move