Initial Push. Implemented clean basic walk button
This commit is contained in:
@@ -16,13 +16,11 @@ public class PlayerController : MonoBehaviour
|
|||||||
public float gravity = 5.0f;
|
public float gravity = 5.0f;
|
||||||
|
|
||||||
private bool extraJump = true;
|
private bool extraJump = true;
|
||||||
private float tempSpeed;
|
|
||||||
private Vector3 moveDirection;
|
private Vector3 moveDirection;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
characterController = GetComponent<CharacterController>();
|
characterController = GetComponent<CharacterController>();
|
||||||
tempSpeed = speed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@@ -48,10 +46,8 @@ public class PlayerController : MonoBehaviour
|
|||||||
if(Input.GetKey(KeyCode.LeftShift))
|
if(Input.GetKey(KeyCode.LeftShift))
|
||||||
{
|
{
|
||||||
moveDirection = (moveDirection.normalized * speed/2);
|
moveDirection = (moveDirection.normalized * speed/2);
|
||||||
tempSpeed = speed/2;
|
|
||||||
} else {
|
} else {
|
||||||
moveDirection = moveDirection.normalized * speed;
|
moveDirection = moveDirection.normalized * speed;
|
||||||
tempSpeed = speed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input.GetButtonDown("Jump"))
|
if (Input.GetButtonDown("Jump"))
|
||||||
|
|||||||
Reference in New Issue
Block a user