Hey, I’m trying to simply translate the camera from one position to the next. I’m getting the error;
Assets/Scripts/InGameGUI.js(471,46): BCE0023: No appropriate version of ‘UnityEngine.Mathf.SmoothDamp’ for the argument list ‘(UnityEngine.Vector3, UnityEngine.Vector3, float)’ was found.
Mathf.SmoothDamp works only on single float values while Vector3.SmoothDamp works on vector3s.
hey thanks for the info Bunny! Unfortunately, when I changed the line to; transform.position = Vector3.SmoothDamp(camStartPosition, camEndPosition, camSpeed * Time.deltaTime); I just recieved a different error; > Assets/Scripts/InGameGUI.js(471,48): BCE0023: No appropriate version of 'UnityEngine.Vector3.SmoothDamp' for the argument list '(UnityEngine.Vector3, UnityEngine.Vector3, float)' was found. :(
Hi, @Ryan got point, you are giving the start position, you should give the current position (which is the same as start position only at the start ) and apply that return value to current position.
You must also give the velocity parameter as reference so that the function can modify it and use the new velocity value next time.
And the 4th param should represent time as float. Something that won’t change.
Also execution order is not correct I think.
So it should be something like this : (c#)
void camStart() {
float smoothTime = 5.5f;
Vector3 camStartPosition = new Vector3 (11.5, 0, -5);
var camEndPosition = new Vector3 (0, 0, -5);
var velocity = new Vector3 (-5, 0, 0);
transform.position = camStartPosition;
Didn't I mention that in my comment that is 2 years old? Ryan just repeated some of my points but got the Time.deltaTime wrong again. His post is actually one year old....
hey thanks for the info Bunny! Unfortunately, when I changed the line to; transform.position = Vector3.SmoothDamp(camStartPosition, camEndPosition, camSpeed * Time.deltaTime); I just recieved a different error; > Assets/Scripts/InGameGUI.js(471,48): BCE0023: No appropriate version of 'UnityEngine.Vector3.SmoothDamp' for the argument list '(UnityEngine.Vector3, UnityEngine.Vector3, float)' was found. :(
– Rick74