Picking nearest object

I want an object to move to the nearest object, but it goes towards the Center point, rather than to the edge of the object.

Would there be a way for me to get the object to move to the closet edge of another object?

Try using a raycast and taking the contact points (the result x & Y position values in the raycast condition).

What type of objects are you using, square, circular or irregular? Is it free moving, grid based, top down… The more details the better.

Like large rectangular blocks, just static. Top down.

Actually never mind, I just had it move to some smaller objects that were overlapping the larger objects. Just jerry rigged it to be similar enough. Thanks for the responses!

1 Like