Merge pull request #25496 from ptrojahn/lookat

Fix look_at with non uniform scaling
This commit is contained in:
Rémi Verschelde 2019-02-12 13:41:42 +01:00 committed by GitHub
commit dfe4990b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -376,7 +376,7 @@ void Node2D::look_at(const Vector2 &p_pos) {
float Node2D::get_angle_to(const Vector2 &p_pos) const {
return (get_global_transform().affine_inverse().xform(p_pos)).angle();
return (to_local(p_pos) * get_scale()).angle();
}
Point2 Node2D::to_local(Point2 p_global) const {