unity rotate object around local axis code example
Example: rotation around own axis in unity
transform.RotateAround(transform.position, transform.up, Time.deltaTime * 90f);
transform.RotateAround(transform.position, transform.up, Time.deltaTime * 90f);