I still have problem with first question, i try all codes but wont work frown .
I will try explain better what i need. I move my player only on x axis left and right, and z is my gravity (like in 2D games). I need when my player walk in some direction where is located some static entity (for this i use variable player_walk_direction) , how i can know did my moving direction looks at this static entity or player is turn back of this entity?

Here example:

Code:
E entity
< player walk left
> player walk right
        
          E
                  
  >              <
-------------------- // player_look_at_entity = 1;


          E

  <              >
-------------------- // player_look_at_entity = 0;





Thx