Merge pull request #5 from gjcampbell777/walk_button

Initial Push. Implemented clean basic walk button
This commit is contained in:
Gregory Campbell
2019-09-30 21:31:44 -04:00
committed by GitHub
+7
View File
@@ -44,6 +44,13 @@ public class PlayerController : MonoBehaviour
extraJump = true; extraJump = true;
moveDirection.y = 0.0f; moveDirection.y = 0.0f;
if(Input.GetKey(KeyCode.LeftShift))
{
moveDirection = (moveDirection.normalized * speed/2);
} else {
moveDirection = moveDirection.normalized * speed;
}
if (Input.GetButtonDown("Jump")) if (Input.GetButtonDown("Jump"))
{ {
moveDirection.y = jumpSpeed; moveDirection.y = jumpSpeed;