Hi ALL,
I am trying to resolve a really vague issue which is taking lot of my time to resolve.
I have a third person up and running in the game with both its Controller and camera atached to the component.
Issues are -
- Can the rotation on pressing “a” and “d” be reduced to 10- 15 degrees rather than 90.
- On pressing “s” key can the behavior be changed from rotating 180 to move backwards.
The script i am using is the basic script provided by unity , namely " Third person controller Script".
I assume following is the code taking care of rotation in the script -
if (targetDirection != Vector3.zero)
{
// If we are really slow, just snap to the target direction
if (moveSpeed < walkSpeed * 0.9 && grounded)
{
moveDirection = targetDirection.normalized;
}
// Otherwise smoothly turn towards it
else
{
moveDirection = Vector3.RotateTowards(moveDirection, targetDirection, rotateSpeed * Mathf.Deg2Rad * Time.deltaTime, 1000);
moveDirection = moveDirection.normalized;
}
}
What should be modified for above mentioned changes.
Thank you !!!