void FixedUpdate()
{
///rotate character model if stick is tilted right or left, but only if character is moving in that direction.
if (IsInLocomotion () && ((direction >= 0 && horizontal >= 0) || (direction < 0 && horizontal < 0)))
{
Vector3 rotationAmount = Vector3.Lerp (Vector3.zero, new Vector3 (0f, rotationDegreePerSecond* (horizontal < 0f ? -1f : 1f), 0f), Mathf.Abs);
Quaternion deltaRotation = Quaternion.Euler (rotationAmount * Time.deltaTime);
this.transform.rotation = (this.transform.rotation * deltaRotation);
}
}
this one specific part of my code is giving me an error. If anyone would happen to know what exactly is wrong with it it i would be very grateful.
i keep getting the error
Assets/CharacterControllerLogics.cs(100,58): error CS1502: The best overloaded method match for `UnityEngine.Vector3.Lerp(UnityEngine.Vector3, UnityEngine.Vector3, float)' has some invalid arguments
and
Assets/CharacterControllerLogics.cs(100,58): error CS1503: Argument
#3' cannot convertmethod group' expression to type `float'