c# - I seem to be getting an error in Unity regarding the end of 9th line down -
void fixedupdate() { ///rotate character model if stick tilted right or left, if character moving in 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 1 specific part of code giving me error. if happen know wrong it grateful.
i maintain getting error
assets/charactercontrollerlogics.cs(100,58): error cs1502: best overloaded method match `unityengine.vector3.lerp(unityengine.vector3, unityengine.vector3, float)' has invalid arguments
and
assets/charactercontrollerlogics.cs(100,58): error cs1503: argument #3' cannot convert
method group' look type `float'
you're passing mathf.abs
(a method) method that's expecting float
3rd parameter. perhaps supposed supplying value mathf.abs
(the result of of type float
)? e.g.:
vector3.lerp (vector3.zero, new vector3 (0f, rotationdegreepersecond * (horizontal < 0f ? -1f : 1f), 0f), mathf.abs(42.0)); ^^^^^^
c# unity3d
No comments:
Post a Comment