I came across a problem, when creating my game on godot

Viewed 46

I'm making a top down style game where the weapon revolves around the character. When I aim with my mouse to the right the sprite is normal... however, when aiming to the left I would need to use Flip V to invert my sprite and weapon to be normal. But I can't check if the mouse is to the right or left of my character to know when to activate and deactivate the option

https://www.youtube.com/watch?v=SQNl2e9lhzQ

I saw this video of yours that in theory would solve my problem... but I couldn't replicate it in my code. Since my structure is different

this is the code i use to make my weapon follow the mouse

    var mouse_pos = get_global_mouse_position()
    get_node("gun").look_at(mouse_pos)
1 Answers
Related