- Home /
 
Converting unit to inches/meters
So I've done a code that takes the object's scale sizes and puts it into a text. The problem is, I'd like to know how can I convert this text's value into inches or meters since it uses the default scale values. Any help would be appreciated. Thank you in advance!
Here's the code that I'am using
 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class ScaleSlider : MonoBehaviour {
 
     public Slider sliderLength;
     public Slider sliderWidth;
     public Slider sliderHeight;
     public Text textLength;
     public Text textWidth;
     public Text textHeight;
 
     // Use this for initialization
     void Start () {
         sliderWidth.value = 0.5f;
         sliderLength.value = 0.5f;
         sliderHeight.value = 0.5f;
     }
 
     void Update () {
         textLength.text = transform.localScale.x.ToString ();
         textWidth.text = transform.localScale.y.ToString ();
         textHeight.text = transform.localScale.z.ToString ();
         transform.localScale = new Vector3(sliderLength.value*1f, sliderWidth.value*1f, sliderHeight.value*1f);
     }
         
 }
 
               And here's the scale size that I wanted to convert into meters/inches 
 
                 
                asd.jpg 
                (5.2 kB) 
               
 
              
               Comment
              
 
               
              Your answer