I'm trying to make something that allows you to grab an object and it will gradually slide toward the mouse which I have done using Vector3.Lerp. This part works fine. I want the object to stop moving when it hits an obstacle in between it and the mouse point but still be able to move around it should the position of the mouse change.
In other words, if an object is moving toward the mouse and an obstacle blocks it, the object should sort of start to slide around the obstacle.
I have no idea how I can go about doing this.
↧