My code works perfectly fine in another game of mine, so I am not sure why it does not work now. I tried workspace.Robot.Humanoid:MoveTo(workspace.ChupaMiUwU.HumanoidRootPart.Position) in the command bar just to test and it did not move my robot. My code goes:
local function walkTo(target)
targetReached = false;
hum:MoveTo(target.Position,target);
repeat wait() until (targetReached == true);
end;
local function destinationReached()
targetReached = true;
end;
hum.MoveToFinished:Connect(destinationReached);
I have defined all my variables (again it works in my other game) but the robot just does not move. It throws no error and continues executing code afterwards, as if it did walk to the target (thread pauses for a while ‘simulating’ the movement of the humanoid but it does not actually move). Please let me know if you know how I can fix this, thank you! uwu
Well I am no expert with NPCs, however I used the exact same model I built for my other game (directly copied) and it worked perfectly fine.
JUST tried something and I have no idea why it worked. I placed it in ServerStorage and cloned it into Workspace, that way the MoveTo() function works. Thank you both for your help! Still if you have a solution that does not require me to do this it would be of great help. ^-^