works now for 2D & fix for newer Unity versions