# Normalise a value

How do I got about normalising a value between 0.0 and 1.0,

For example the values are -3 and 10.

The unity engine only seems to have built-in functionality for normalizing Unity’s Vector2, Vector3 and Vector4 types. The example below prints(-0.3, 1.0), the vector (-3,10) with a magnitude of 1.

public class normalize : MonoBehaviour {

Vector2 original = new Vector2 (-3,10);

void Start () {
print(original.normalized);
}
}

Here it is in the scripting reference: http://unity3d.com/support/documentation/ScriptReference/Vector2-normalized.html I am not sure if this solution will meet your needs, but hope it is of some help.

if you want to Lean JS for programming these are tutorials for beginngers
learn this and you will be able to make these all

you can just do

public class normalize : MonoBehaviour {

Vector2 original = new Vector2 (-3,10);

void Start () {
print(original.normalized);
}
}

you can also use some math operator if you want that if its greater than any number or less than any nummber

public class normalize : MonoBehaviour {

//this means 10 -3 = answer
Vector2 original = new Vector2 (-3,10);

// if answer is greater than 7
if (new Vector > 7) {

// do this..you can add function here what you want if its greater than 7
}

// if answer is less than 7
if (new Vector < 7) {

// do this..you can add function here what you want if its greater than 7