What I want is if the device is rotated 90 degrees to the left, cube should fall down as shown below
I came up with a solution to tackle that by modifying the
Physics2D.Gravity vector so it should be like following
- Device rotation 0, vector(0, -9.81).
- Device rotation -90, vector(-9.81, 0).
- Device rotation 180, vector(0, 9.81). And so on (Rotation would be anything between 0 to 360 degrees).
I don't know how to calculate that vector based on rotation degree. Any suggestion is much appreciated.