Rotate from HorizantalSlider in local not global help.

Okay hoping this will be easy for some one to answer, i have this script that will rotate an object from the slider, but the parent object will also be rotating, and for some reason it isn’t rotating on local, just global, but with the parent also spinning i need it only to be local.

function Update()

{

if (hSliderValue != oldh)

{

	transform.rotation = Quaternion.identity;

	transform.Rotate(0, hSliderValue, 0,Space.Self);

	oldh = hSliderValue;

}

}

function OnGUI ()
{

hSliderValue = GUI.HorizontalSlider (Rect (5,Screen.height - 40, 200, 30), hSliderValue, 0, 270);

}

Your exact condition and behavior is unclear. You may be able to get what you want by changing line 5 to:

   transform.localRotation = Quaternion.identity;