- Home /
BCE0023: No appropriate version of 'UnityEngine.Mathf.SmoothDamp' for the argument list '(float, int, Object, float)' was found.
I get the error : "BCE0023: No appropriate version of 'UnityEngine.Mathf.SmoothDamp' for the argument list '(float, int, Object, float)' was found." when using the following code to move the gun from the hip to the aiming position.
if (Input.GetButton("Fire2"))
ratioHipHold = Mathf.SmoothDamp(ratioHipHold, 0, ratioHipHoldV, hipToAimSpeed);
if (Input.GetButton("Fire2") == false)
ratioHipHold = Mathf.SmoothDamp(ratioHipHold, 1, ratioHipHoldV, hipToAimSpeed);
Edit: Here you go:
var ratioHipHold : float = 1;
var hipToAimSpeed : float = 0.1;
@HideInInspector
var ratioHipHoldV;
Can you show how you define those variables? It appears that ratioHipHoldV is an object - perhaps this is due to it not being defined and #pragma strict not being turned on.
Answer by Eric5h5 · Sep 05, 2012 at 03:19 PM
You must always define the type of variables, either explicitly or by supplying a value.
Your answer
Follow this Question
Related Questions
Scripting a GUI button to move object smoothly 1 Answer
Vector2 does not contain a definition for smoothdamp? 1 Answer
Why is my lerp not working? 1 Answer
Smooth camera shift, Lerp? SmoothShift? 2 Answers
SmoothDamp won't reach its target 1 Answer