Collision Problem with Rigidbody?

I am making a capture the flag sort of game and I attached a script to my flag that is supposed to switch a boolean in my player’s script to “true”. However, it only works when the flag’s rigidbody is set to “Uses gravity”, but when “uses gravity” is turned on, the flag flies around all over the place!
Does anyone know how this problem can be fixed? All that’s supposed to happen is that my player runs into the flag’s box collider (which works fine), then switches a boolean to true which prints out a gui text. When I turn off uses gravity this part doesn’t work but if gravity is on and I run around and manage to hit the flag, it does work.
Thanks a lot!

You could try adding a cube where your flag is and use isTrigger to change your boolean.