how would I normalize a vector 3?

can’t find any examples

Vector3 asdf = new Vector3(1f, 2f, 3f);
asdf.Normalize();

how would I normalize Vector3.right? I tried the method you just did but it seems it requires different coding

Vector3.right is already normalized.

hmm that’s strange. basically, I’m trying to code something to move on the right analog stick but it reads the input even if the stick is in the middle. this is different to the left analog stick as that works fine. what do you think I should do?

transform.Translate (Vector3.down * Input.GetAxis (“vertical”) * playerSpeed * Time.deltaTime);
transform.Translate(Vector3.right * Input.GetAxis(“horizontal”) * playerSpeed * Time.deltaTime);

the vertical and horizontal are for the right analog stick, however, it just has erratic movement. I can control it but not smoothly at all and it never stops. how would I normalise it?

Could you record a video of what you mean by “Erratic movement”? And a little more context on those lines of code would be good.

Have you tried using another controller?

Your problem with input being read while the analog stick is in the default position probably means your zero input threshold is too small.

The effect being different for both analog sticks is more likely the fault of the controller and not Unity. Heck even your “erratic movement” could be a hardware problem too. Analog sticks can and will suffer from wear and tear, causing the hardware to not be as resistive as before, or not perform as it should anymore.

Your definition of normalize seems different from the math definition. In layman terms, normalize forces the magnitude of a vector to be 1 in length, and that’s it. It has nothing to do with your analog sticks.

As far as normalizing your movement vector goes, you will have to do something like this:

//get movement vector
Vector3 moveDir = new Vector3 (Input.GetAxis("horizontal"), -Input.GetAxis("vertical"), 0);
//apply to movement
transform,Translate (moveDir.normalized * playerSpeed * Time.deltaTime);

Do note that sensitivity tracking is lost because of what normalize does.