【发布时间】:2014-10-22 11:37:35
【问题描述】:
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);
}
}
我的代码的这一特定部分给了我一个错误。如果有人碰巧知道它到底有什么问题,我将非常感激。
我不断收到错误
Assets/CharacterControllerLogics.cs(100,58):错误 CS1502:最好的 重载方法匹配 `UnityEngine.Vector3.Lerp(UnityEngine.Vector3, UnityEngine.Vector3, float)' 有一些无效的参数
和
Assets/CharacterControllerLogics.cs(100,58):错误 CS1503:参数
#3' cannot convertmethod group' 表达式来输入 `float'
【问题讨论】: