> Do you mean a patrolling enemy that changes direction when it reaches the platform edge? You can put invisible sprites at the end of the platform, when it touches one of them toggle a boolean that relates to simulating left/right on the enemy platform behaviour.
I would like a solution that does not require a physical barrier, that works in a more universal and adaptable way. There will not always be a wall in front of the enemy. Sometimes there will be a precipice.
So that works then, you place the invisible sprite wherever you want.