Oleh-Halitskiy / CounterOffensive

Unity project inspired by Dayz, CSGO and other games that I play.
2 stars 0 forks source link

Normalize walking vector #14

Closed Oleh-Halitskiy closed 2 years ago

Oleh-Halitskiy commented 2 years ago

void GetInput() { jumpInput = Input.GetButton("Jump"); xInput = Input.GetAxisRaw("Horizontal"); yInput = Input.GetAxisRaw("Vertical"); movementVector = transform.forward yInput + transform.right xInput; moveDirection = Vector3.SmoothDamp(moveDirection, movementVector.normalized, ref moveVelocity, vel);

}

this could be used as start
Oleh-Halitskiy commented 2 years ago

characterController.Move(moveDirection movementSpeed Time.deltaTime);