Hi, sorry i’m Unity beginner and i’m frustated with my current problem.
Well i build a running game that player will run until finish line. Near the finish line i want my player stop slowly, i mean the speed movement slowly reduce until its completely stop. how to do that? i have looking for it around this page but i did’t get what i need. I try using AddForce but i didn’t understand what it is. So, anybody know the simple easy way to do my animation?
i move my player with this code example :
if (Input.GetMouseButtonDown(0) && flagStart==0 && counter==0)
{
dir = Vector3.forward; flagStart = 1;
}
and here what should i do to my code :
void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
//code to stop slowly
}
}