float standardZRotation;
public void InvertRotation(){
// standardYRotation = -standardYRotation;
// abhishesh================
standardZRotation = 180;
character.transform.localScale = new Vector3 (-character.transform.localScale.x, -character.transform.localScale.y, -character.transform.localScale.z);
// ================
}
private void testCharacterRotation(float rotationSpeed){
testCharacterRotation(rotationSpeed, false);
}
private void testCharacterRotation(float rotationSpeed, bool forceMirror){
if ((mirror == -1 || forceMirror) && transform.position.x > opponent.transform.position.x) {
mirror = 1;
InvertRotation();
if (UFE.config.characterRotationOptions.autoMirror) ForceMirror(true);
//abhishesh==========
character.transform.eulerAngles = new Vector3 (character.transform.eulerAngles.x, 90, character.transform.eulerAngles.z);
//=================
}else if ((mirror == 1 || forceMirror) && transform.position.x < opponent.transform.position.x) {
mirror = -1;
potentialBlock = false;
InvertRotation();
if (UFE.config.characterRotationOptions.autoMirror) ForceMirror(false);
// abhishesh================
standardZRotation = 0;
character.transform.localScale = new Vector3 (character.transform.localScale.x, character.transform.localScale.y, character.transform.localScale.z);
//================
}
// character.transform.rotation = Quaternion.Slerp(character.transform.rotation, Quaternion.AngleAxis(standardYRotation, Vector3.up), Time.fixedDeltaTime * rotationSpeed);
// abhishesh================
character.transform.rotation = Quaternion.Slerp(character.transform.rotation, Quaternion.AngleAxis(standardZRotation, Vector3.forward), Time.fixedDeltaTime * rotationSpeed);
character.transform.eulerAngles = new Vector3 (character.transform.eulerAngles.x, 90, character.transform.eulerAngles.z);
//================
}
private void fixCharacterRotation(){
if (currentState == PossibleStates.Down) return;
// if (character.transform.rotation != Quaternion.AngleAxis(standardYRotation, Vector3.up)){
// character.transform.rotation = Quaternion.AngleAxis(standardYRotation, Vector3.up);
// }
}
replace above code in controlsScript.cs and uncheck autorotation from global editor window