You need to program a script that will check if there are any other agents/obstacles and then change the position of the object you want to move.