How to detect an object that moves in an opposite direction?

For example, an enemy is go to the right, but it was supposed to go to the left so I need a code that will detect and check that enemy if it goes to right and if it does, there should be a code to make it go to the left.

Just make it go to the left only and not the right

You can do this two ways, I guess. You can use a filter to check if the velocity is negative/positive. Or you can use pixel velocity, which I have a bundle for. Let me know if you want my bundle, or need any more help.

I mean like an object that detect which direction the other objects is going.

Do what Overma said or just use extractors to tell the rotation.