title: Change position of gameobjects with slider
body: <p>I have 4 gameobject in my game and I want to change X and Y values of these objects with slider. But I don't know how will I do that. I need to help.</p>
  
  <p>Now, I use button to play animation with the code below but I want to change gameobject positions with slider.</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class playbut : MonoBehaviour {
  public GameObject anim;
  public GameObject anim1;
  public GameObject anim2;
  public GameObject scrool;
  // Use this for initialization
  void Start () {
  
  }
  
  // Update is called once per frame
  void Update () {
  
  }
  public void OnClick(){
      anim.GetComponent&lt;Animator&gt; ().Play ("div");
      anim1.GetComponent&lt;Animator&gt; ().Play ("div1");
      StartCoroutine(WaitandPrint(2));
      anim2.GetComponent&lt;Animator&gt; ().Play ("div2");
  }
  
  
  private IEnumerator WaitandPrint(float waitTime)
  {
      yield return new WaitForSeconds (waitTime);
  
      scrool.SetActive (true);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here is what I want : </p>
  
  <p>All of position of the gameobjects is X : -2.6 Y : -2.09 but when I slide the slider the position of the gameobjects should be like that : </p>
  
  <p>Gameobject 1 = X:2.5 Y:-0.03</p>
  
  <p>Gameobject 2 = X:-5.74 Y:0.09</p>
  
  <p>Gameobject 3 = X:-2.18 Y:2.48</p>
  
  <p>Gameobject 4 = X:-2.6 Y:-2.09 </p>