Having a big trackball that handles multiple objects rotation. How do I keep the rotation unique for each??

So in the middle of the scene I have what you can call a big trackball. It is rotated in two axis with the mouse and it works fine.

I can also select four different spheres on the level through a different interaction. that will let me control them with the trackball. Only one can be selected and controlled at a time. At the moment I’m doing this in the update of the four spheres:

void Update () {
	if (Active == true) {
		gameObject.transform.rotation = Trackball.transform.rotation;
	}
}

The thing is when the sphere becomes active it just jumps to the same rotation as the trackball. I would want to just want to add each new rotation.

Thanks in advance!

You’ll want to track the change in rotation of the Trackball every frame, and instead of assigning rotation to the active sphere, you add it to the sphere’s rotation.

     if (BigSphereClicked == true) {
                 MouseOffset = Input.mousePosition - MouseReference;
                 SphereRotation.y = -MouseOffset.x * Sensetivty;
                 SphereRotation.z = MouseOffset.y * Sensetivty;
                 DeltaRotation = SphereRotation;     // public property to use with small sphere   
                 BigSphere.transform.Rotate (SphereRotation);
                 MouseReference = Input.mousePosition;
     }

and then instead of simply assigning the rotation to the active sphere, you apply the rotation

gameObject.transform.Rotate(Trackball.DeltaRotation);