Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity normalize movement

 //Normalizing the Input Vector and afterwards adding speed if needed!
 
 float h = Input.GetAxis("Horizontal");
 float v = Input.GetAxis("Vertical");
 Vector3 inputVector = new Vector2( h, 0, v );
 inputVector.Normalize();
 
PREVIOUS NEXT
Tagged: #unity #normalize #movement
ADD COMMENT
Topic
Name
6+1 =