Another type of movement that we can implement on our enemies or platforms is the trigger movement. This is also a basic way to create movement, where the enemy or platform is moving in one direction until it collides against something and then returns back. We can see this on multiple games, especially 2D platforms.
As we can see in the preceding image, the green circle represents the enemy and the red arrow represents the trigger distance. When the trigger touches the wall, the enemy turns around and moves in the opposite direction.
When should we use this method instead of the animation one? Using the animation movement, ...