Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void GroundMove()
- {
- gravity = -9f;
- GetDirectionFromWASD();
- movement = new Vector3(this.deltaX, 0, this.deltaZ) * currentSpeed;
- movement = Vector3.ClampMagnitude(movement, currentSpeed);
- movement.y = gravity;
- movement *= Time.deltaTime;
- movement = transform.TransformDirection(movement);
- characterController.Move(movement);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement