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

Assign Material in View Unity Part 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Assign Material in View Unity Part 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

You just create a script and put in the scene this file have for parts, follow

comment p4

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