I am developing a top down game and my character is not moving when i click at it
this is the local script
mouse.Button1Down:Connect(function()
if mouse.Target and mouse.Target.Parent:HasTag("Unit",true) then
char:AddCharacter(mouse.Target.Parent)
end
if char:IsActive() then
print(2)
char:MoveToLocation(Vector3.new(100,0,1000))
end
end)
Module script:
local characterFunctions = {}
characterFunctions.character = nil
function characterFunctions:AddCharacter(char)
characterFunctions.character = char
print("success")
end
function characterFunctions:MoveToLocation(Pos: Vector3)
if characterFunctions.character then
print("Moving To")
if characterFunctions.character.Humanoid then
print(5)
end
characterFunctions.character.Humanoid:MoveTo(Pos)
characterFunctions.character.Humanoid.MoveToFinished:Wait()
end
end
function characterFunctions:IsActive()
if characterFunctions.character then
return true
else
return false
end
end
return characterFunctions
Every thing seems to print normal but only the character is not moving