![]() ![]() MoveDirection.y -= gravity * ltaTime ĬharacterController.Move(moveDirection * ltaTime) This is because gravity should be applied when the moveDirection is multiplied by deltaTime). Gravity is multiplied by deltaTime twice (once here, and once below MoveDirection = (forward * curSpeedX) + (right * curSpeedY) Vector3 right = transform.TransformDirection(Vector3.right) įloat curSpeedX = canMove ? speed * Input.GetAxis("Vertical") : 0 įloat curSpeedY = canMove ? speed * Input.GetAxis("Horizontal") : 0 Vector3 forward = transform.TransformDirection(Vector3.forward) ![]() We are grounded, so recalculate move direction based on axes ![]() Public class SC_TPSController : MonoBehaviour
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |