Assign Material in View Unity Part 4
Assign Material in View Unity Part 4
comment p4
moveDirection.y = jumpPower;
}
else
{
moveDirection.y = movementDirectionY;
}
if (!characterController.isGrounded)
{
moveDirection.y -= gravity * Time.deltaTime;
}
#endregion
if (canMove)
{
rotationX += -Input.GetAxis("Mouse Y") * lookSpeed;
rotationX = Mathf.Clamp(rotationX, -lookXLimit, lookXLimit);
playerCamera.transform.localRotation = Quaternion.Euler(rotationX,
0, 0);
transform.rotation *= Quaternion.Euler(0, Input.GetAxis("Mouse X") *
lookSpeed, 0);
}
#endregion
}
}