Question by
heartshapedbox · Aug 16, 2019 at 09:03 AM ·
gradually
How to Gradually decrease value by time?
I want to make my value changes gradually.
my object moves to targetX.
and i want to my object gradually slow down as it get close to targetX
void Update()
{
float targetX = Input.x * moveSpeed;
moveAmount.x = Mathf.SmoothDamp(moveAmount.x, targetX);
}
so i want to multiplay some value at this line. float targetX = Input.x moveSpeed somevalue;
what should i do?
thanks
Comment
Your answer
