Hi!
MarkD:
It was not exactly what I was looking for, but I got some other tip there.
I was more looking for 2D side scrolling.
4arrancho:
I found a way which works, but I don't know if this is the best way to do it. Probably not.
First I set up to FSM. Shooting Left side and Shooting Right side.
Then I create a new FSM where I use a raycast which is checking the direction. I place a cube on each side of the level. So when I walk to the right and the raycast hits the cube on right side, I disable the FSM "Shooting Left side" and enable the FSM "Shooting Right side" and the same when I walk to the left.
This is just one of very many ways to do it. If this is a good or bad way to do it, it depends. But as long as it works.
I think Jean Fabre should make some 2D samples or something where 2D shooting will be a part of that.
Or else I would be very happy and grateful if somebody could make other and maybe better examples.