Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a more precise Humanoid:MoveTo()?

After the influx of tower defense games on Roblox, it made me into the mood of making a tower defense game myself. As of right now I'm trying to create a enemy AI where it uses humanoids (MoveTo) to travel on the path, unfortunately the enemy doesn't fully travels all the way to make a full turn, and instead travels until it reaches the corner and turns early, the result is the enemy being partially off from it's path.

Essentially I'm asking for a more precise Humanoid:MoveTo() where it's actually stands right on top of it's destination, instead of just barely touching it's destination.

(I don't really need to post the script since it's just Humanoid:MoveTo().)

I just need some pointers in the right direction instead of getting an entire script.

(Tried posting this in the Roblox subreddit, gotten automatically deleted by the AutoModerator.)

1 answer

The easiest way to fix it would be to add a MoveToFinished:Wait() function. Basically, this function lets you control how much time you give your AI to move. So, if it is just Human:MoveTo() function, the character will not be able to make it in time of the waypoint. I recommend setting MoveToFinished:Wait() to 2, which will give you MoveToFinished:Wait(2)

1 comment

0

Thanks for trying to help me, but your answer isn't the one I'm looking for, I've already used MoveToFinished:Wait() before posting this, I'm trying to look for a piece of code that makes the enemy fully reaches it's attended destination before moving on to the next destination.

This discussion is preserved as it was. New answers, comments, and votes are closed.