Another way of solving the problem of speed

Hi people I use another way to solve the problem of the speed of the click run I take it on the ThirdPersonCharacter.cs a little change
on Move() function I put one bool more

public void Move(Vector3 move, bool crouch, bool jump, bool click)//to check if is a click comand or not

and on the being of this function when wil calculate the Turn and Forward amount I check if is use mouse click if yes multiply all for 10 if not use normalized (ba dum tss) values.

        if (click) {
			m_TurnAmount = Mathf.Atan2 (move.x*10, move.z*10);
			m_ForwardAmount = move.z*10;
		} else {
			
			m_TurnAmount = Mathf.Atan2 (move.x, move.z);
			m_ForwardAmount = move.z;
		}

and all will be nice … on keyboard and on mouse click to move take the same speed ^^
and if some one wanna do changes on Unity scripts need take so much atention because the little bit I do I need make alterations on 3 another unity script … it’s only set false or true on the calling of function Move() true if I wanna use a mouse commnd to this calling time (some action with Ethan or AIcombat script) and false to not use mouse, on this script the alteration I did all time when click is true the script away’ll multiply by 10 the turn and forward amounts.

Privacy & Terms