Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# sprint key

if (Input.GetKey("left shift")){ // If Player Presses Shift Key
	Sprint = 2f; // Sprint Double Speed
} else {
	Sprint = 1f; // Disable Sprint
}

// Move Player
controller.Move(move * speed * Sprint * Time.deltaTime); 
// Move is your Player Move Variable
 
PREVIOUS NEXT
Tagged: #sprint #key
ADD COMMENT
Topic
Name
8+2 =