move object towards area unity code example
Example 1: how to move towards an object unity
//This will work for 2d or 3d platforms
//Make sure to call in Update or else it wont work
Vector3.MoveTowards(transform.position, taretPos, Qiaternion.identiy)
Example 2: how to make an object move towards another in unity
transform.position = Vector3.MoveTowards(transform.position, taretPos, Qiaternion.identiy)