I have 2 docks, 1 on one side of an island, and another in the opposite side of the island. One docking area’s x vector position is > 0 and the other is < 0, which I use for the condition for my code to switch some numbers. Im trying to make npc’s move across the end of my dock, 1 dock works, the one that’s < 0, but the other one doesn’t, there’s a line that just does not work.
worker:MoveTo(Vector3.new(worker.HumanoidRootPart.Position.X - 30 + (sum * 2),worker.HumanoidRootPart.Position.Y,worker.HumanoidRootPart.Position.Z))
worker.Humanoid:MoveTo(Vector3.new(worker.HumanoidRootPart.Position.X - 85 + (sum * 2),worker.HumanoidRootPart.Position.Y,v.woodDock.Position.Z))
The worker is not anchored, I printed earlier in the code and none of its base parts are anchored, no errors, I printed the vector 3 for the models:moveTo and the workers humanoid:moveTo to make sure im not putting the same vector position which means the worker.Humanoid:MoveTo() will not work, but they have different values, meaning that worker.Humanoid:MoveTo should work, model:MoveTo():1004.5001220703125, 7.999053955078125, 21.99975585937, model.Humanoid:MoveTo():949.5001220703125, 7.999053955078125, 21.999755859375
I do not know what’s wrong, I have another line of the script right after the model.Humanoid:MoveTo()
worker.Humanoid.MoveToFinished:Wait()
Which when it didn’t seem it was waiting because the other parts of my script ran instantly instead of that line yielding the script, is how I found out that the worker.Humanoid:MoveTo() is not working.
Also, I’ve printed every variable those lines are associated with, like the dock, the cam, and they are not nil, and the script this is in is a local script, but I can’t see anything wrong with that because this script works fine for the other side of the island’s dock, the only change is I switched 2 negatives to a positive and a positive to a negative so that the npc can go the other direction. Can you guys spot anything wrong, any suggestion on how I can uncover anything more to see if there’s potential problems linked to that? I apologize if it seems I spelled anything weirdly, like some coding or studio terms, because my MacBook likes auto correcting everything.