Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom Character doesnt allow the player to move? [SOLVED]

Asked by 5 years ago
Edited 5 years ago

I am trying to make a top down camera that both follows the character and the mouse at the same time, so basically it gets the player position and the mouse position and gets the distance between them then divides that by 2. When I do this though it doesn't appear to let the character move? So I am really confused honestly XD

Heres my code

function UpdateCamera()
local CharacterPosition = Vector3.new(Character.PrimaryPart.Position.X, 0, Character.PrimaryPart.Position.Z)
local MouseHitPosition = Vector3.new(Mouse.Hit.Position.X, 0, Mouse.Hit.Position.Z)
local CalculatedPosition = (MouseHitPosition - CharacterPosition) / 2
Camera.CFrame = CFrame.new(CalculatedPosition + Vector3.new(0, 75, .05)) * CFrame.Angles(-math.pi/2, 0, 0)
end

Thank you and also heres a gif as well https://gyazo.com/df65bba62e19e248509f9b24d0a8aa6a

Answer this question