2D Game in unreal engine 5.0.3 question

Im making my first ever game in unreal engine 5.0.3, and Im really struggling with something. I cant figure out how to make a 2D paper character have an AI system to make it move back and forth (kinda like a gomba in the original super Mario). Someone please help.

You can setup a system like this in a variety of ways. The easiest is to create an actor with a spline then loop the character back and forth over the spline. On character collision damage the character, kill it or execute some function.