Is there still no simple solution for adjusting gravity direction?

Please share the snippet of the code, That could help others as well .