I'm trying to use the SmoothDamp function to set up smooth incremental movement for my character on key down. I cant seem to get it to work at all. Is there something I'm doing wrong or can someone recommend another way of being able to move a character X amount of distance over Y amount of frames on keyDown?
private var currVel = Vector3.zero;
private var smoothTime: float = 20;
if(Input.GetKeyUp("w")){
Debug.Log("moved");
var targetPos : Vector3 = Vector3.forward * 2;
transform.position = Vector3.SmoothDamp(transform.position,targetPos, currVel, smoothTime);
}
thank you. I was using lerp before but I was using Time.deltaTime maybe thats why it wasnt working. I'm still getting used the Time class and what all those variations of time actually mean for programming time based actions
– anon50995559