Ok im trying to write a script that will remap a value to a new range. In the example, the 'currentt' value will always be between zeroAngle and 180Angle. These are subject to change at runtime. I need a script that will translate the current int a corresponding value. ZeroAngle becomes 0 and 180Angle becomes 180. Code (csharp): public HingeJoint H; public float current=0; public int ZeroAngle = -45; public int 180Angle = 128; // Use this for initialization void Start () { } // Update is called once per frame void Update () { float RemappedValue = Remap (current); }
Something like this? remap number range, http://forum.unity3d.com/threads/119437-Re-map-a-number-from-one-range-to-another