Rotating gameobject via slider

Hi there,

I’m absolutely new to programming, and currently I have the following issue:

I have a 3d-Object whose rotation I want to control both via InputField and Slider. I made it work with the old GUI-system, but I have issues getting it done with the new UI-System.
In the moment, I can’t even get it to work with the slider only…
How can I “link” the gameobject’s rotation to the slidervalue??
I tried the following, but nothing happens…

private float RotationA;
private GameObject myObject;

	void Start () {
		myObject = GameObject.Find ("myObject");
	}

	public void RotateA()
	{
		RotationA = GameObject.Find("sldr_A").GetComponent<Slider>().value;
		myObject.transform.localEulerAngles = new Vector3 (RotationA, 0, 0);
	}
}

maybe someone could help me out, that would be great!
Thank you in advance!

hi,
thanks for the answer!
I did that before, and it dind’t work. But i found the reason why^^°
there was another script active (the old GUI-script I wrote) which controlled the rotation so it caused an issue. I deactivated it and now everything works! :slight_smile: