easiest way to make enemy movement patterns?

What is the easiest way to make enemy patterns in a platformer? (or any game for that matter). I’m trying to make a simple Goomba-like pattern (going from left to right and right to left) using transform.Translate but it’s a pain because I always have to calculate the World coordinates of my map and if I have to make any change in the level I have to recalculate the enemy’s movement all over again… any good advices? thanks!

Use waypoints.

A waypoint is simply an empty GameObjects. Provide each enemy a list of the waypoints to move to. Then update your level by moving the waypoint around.

There are more complicated techniques as well, building a navmesh and A* pathfinding. But I don’t think you want to go there just yet.