0% found this document useful (0 votes)
4 views

Assign Material in View Unity Part 4

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Assign Material in View Unity Part 4

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

It’s th last past.

You have to join these code to tha last part in previous part,
and it’s help you just drag and drop you material and you in one moment all
mesh will be changed

moveDirection.y = jumpPower;
}
else
{
moveDirection.y = movementDirectionY;
}

if (!characterController.isGrounded)
{
moveDirection.y -= gravity * Time.deltaTime;
}
#endregion

#region Handles Rotation


characterController.Move(moveDirection * Time.deltaTime);

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
}
}

You might also like