How does tower defense simulator path work?

The enemies in tower defense simulator seem to turn so smoothly like a normal human would. My tower defense game has nodes which the enemies turn straight instead of smooth curve.

I tried to use Bézier Curves to smoothen each turn every corner but that only made it worse.

1 Like

You could have less spaced out and more points to create a curve

1 Like

That would take lots of time especially for longer maps.

1 Like

You could also write special code for the mob movement, instead of using the usual walk to point you could add something using CFrame.Angles() to turn the mob in the direction of the point (You could use attributes on the point)

1 Like

The mob movement is fine all I need is how I can make the turns curved every corner TD X turns are very smooth like TDS.

Here’s how I would want my path to be

It has smooth turns each corner instead of boring straight ones.

1 Like

If you are interested in just a perfect curve around corners, you can calculate positions on the circumference of the circle with the current angle (in your use case, probably iterate it from 0-90 degrees (but in radians)) and move the enemy there.

local x = cOrigin.X + RADIUS * math.cos(currentAngle_RAD)
local z = cOrigin.Z + RADIUS * math.sin(currentAngle_RAD)
part.Position = Vector3.new(x, part.Position.Y, z)

cOrigin is the center of the circle.

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.