title: Use Slider to set variable value, without touching the Slider first
body: <p>I have a short script attached to a Text-Gameobject, which sets the text to show the current value / position of a slider. This Text-Gameobject is attached to the sliders On Value Changed-field: ShowSliderValue -> [Dynamic float] TextUpdate</p>
  
  <p>When I press Play, my text does not show the selected value / position immediately. Only when I change the position of the slider, the text changes from "New Text" to the actual value of my slider.
  Technically I want to fire "On Value Changed" when I press play. This way I can avoid any unnecessary dependencies in my script. </p>
  
  <pre><code>using UnityEngine;
  using UnityEngine.UI;
  
  public class ShowSliderValue : MonoBehaviour
  {
      private Text text;
  
      void Awake()
      {
          text = this.GetComponent&lt;Text&gt;();
      }
  
      public void TextUpdate(float value)
      {
          text.text = value.ToString("0.00");
      }
  }
  </code></pre>
  
  <p>While looking for a solution, I found the following video. At 5:06 (to 5:26) they set the default value from 1 to 30, and it just seems to work right out of the box. <a href="https://www.youtube.com/watch?v=HQ8Tttcksu4&amp;feature=youtu.be&amp;t=306" rel="nofollow noreferrer">Click here for youtube link.</a></p>
  
  <p>Is it possible for my text to show the slider value, without moving the slider first or actively asking for the slider value inside the shown script?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here is my current solution:
  I add a script to my Slider that changes the Slider value on Start(). Since the value needs to actually change, <strong>slider.value = slider.value</strong> does not work.</p>
  
  <pre><code>using UnityEngine;
  using UnityEngine.UI;
  
  
  public class SliderTest : MonoBehaviour
  {
      private void Start()
      {
          Slider slider = this.GetComponent&lt;Slider&gt;();
  
          float originalValue = slider.value;
  
          slider.value = slider.maxValue;
          slider.value = slider.minValue;
  
          slider.value = originalValue;
      }
  }
  </code></pre>
  
  <p>This makes sure a value change will happen. Unless minValue = maxValue -which makes a slider obsolete anyway.</p>