I have two GameObjects (we’ll call them A and B). Either one of the objects can be controlled by the player at different points in gameplay. Both objects have a 2D boxcollider and a rigidbody to make them controllable and to keep them from going outside the playing field.
The problem is that I want object A to be immovable when object B is in play, and vice versa (object B is immovable when object A is in play).
Currently, if an object in play collides with an object not in play, it will move that object aside. This is unacceptable.
So, how do I make an object controllable, able to collide with other objects, and not movable by other objects?