Hello there fellow unity community members, i’ve been trying to make a drawer in a dresser to move out (or to open) when interacted with, but when i tried animation the animation never played so now im using this code below to open the drawer. But it’s opening in a blink of an eye, i want it to open realistic, like using lerp or something but i dont know how and all the other feeds about this question is really difficult to understand. Thanks
Goal: The drawer needs to be opened slowly or smooth instead of just teleporting.
#pragma strict
var OpenDrawer : OpenDrawerJS;
var OpenDrawerPosition : Transform;
function Start ()
{
OpenDrawer = GameObject.Find("Player").GetComponent(OpenDrawerJS);
}
function OpenDrawer23333 ()
{
Debug.Log("OpenDrawer");
gameObject.transform.position = OpenDrawerPosition.transform.position;
OpenDrawer.DrawerIsOpen = true;
}