I’ve basically got a sphere rotating on the y axis around an empty game object at 0,0,0 using:
if (Input.GetAxis(“Horizontal”) && Input.GetKey (KeyCode.D)) // if ‘D’ is pressed.
{
transform.RotateAround (gameObject.position, Vector3(0,0,1), speedToRotate * Time.deltaTime); //rotate around gameObject, on y axis at speedToRotate = 5
}
When I rotate the gameObject the sphere continues to rotate around the world y axis not the gameObject’s axis. Is there a way of making it rotate around the local gameObject’s y axis rather than the world y axis?