#How do I Flip childs of parent node relative to global mouse position?

2 messages · Page 1 of 1 (latest)

humble wasp
#

You would have to probably add a pivot for that arm, and then call a "LookAt" on that pivot so it looks at the mouse position.

ebon badger
#

i have that, the problem is that the childs of "Arm" is upside down

using Godot;
using System;

public partial class arm : Marker2D
{
    private Sprite2D _hand;

    public override void _Ready() {
        _hand = GetNode<Sprite2D>("Finger"); //tried to grab the hand sprite and its child
    }
    public override void _PhysicsProcess(double delta) {
        Flip();
    }
    private void Flip() { //flipping attempts
        LookAt(GetGlobalMousePosition());
        Vector2 globalMousePosition = GetGlobalMousePosition();//ignore this
        
    }
}