Which is better... AlignPosition or Humanoid:MoveTo()?

Asking for someone else as they cannot post.

my colleague says…
"i am currently trying to make a TD experience, the thing is that moveto is extremely unoptimised (cause huge amount of lag with a low amount of enemies) and i do not really know anything about align, so i might wanna know which one is better , i also tried to use lerping but i don’t understand anything about it, i was able to make one but it was just extremely laggy (50 times worse than move to) so i scraped that idea.

in studio the enemy movement looks smooth with move to but inside roblox it isn’t at all (5 or more enemies and it starts to lag) and that’s why i want to find a better option than moveto"

2 Likes

What are they moving?
A model?
A player?
A Part?

Is it a straight line movement like an obby platform?
Is it moving a player like a waypoint system?
Is it teleporting a player?

We need specific details because the way you phrased the question is like asking “which is better, a cube or a sphere?” Each is better than the other for different reasons.

2 Likes

oh ok, my bad.

so they’re making like a tower defense simulator and they’re moving those little enemies that come out. they’ve tried both methods but they’re unsure which is better than the other.

https://create.roblox.com/docs/reference/engine/classes/Humanoid#MoveTo

idk

2 Likes

I would recommend putting more details in the description of the topic for others to get it and come up with a solution for your colleague.

Moving forward, if they are making a TDS experience with the function to spawn enemies and go to another area, I believe Humanoid:MoveTo() would be good as well as Pathfinding.

4 Likes

I’ve seen quite a few posts over the years here about people using Pathfinding for tower defense games.
I’ve never used it, but if you search for previous posts the ideas and help in them would probably help your friend out.

1 Like

No, it does not. Are you doing this on the server? If you are, you shouldn’t be. In all TD games that are relatively performant, all towers are shown on the client and not the server. This includes the humanoids moving around.

1 Like

You could check out Character Pathfinding | Roblox Creator Documentation and create invisible borders, so they have to follow a certain path.

1 Like