How would I go about making objects around player float up into the air?

I’m trying to make it so while the player is charging / holding down shift or so, all rigidbodies around him will ~float up into the air~, as if gravity slowly pulled them up, then they stop at a max height I set.

How would I go about doing such a thing? I’ve looked into a lot of levitate / floating questions, but none of them seem to help me with this specifically.

You can use OverlapSphere. Refer to this: Unity - Scripting API: Physics.OverlapSphere

With that, you will be able get all the colliders around the player within a certain radius. Then, for each, check that they have a rigidbody and make them levitate (remove their gravity and increase their y-position slowly, etc).

If you need another example on how to use the OverlapSphere, go here:

just off the top of my head but you could add a box collider to the player and set it as trigger and add a script that would look for a tag that is on the objects around the player and when it collides with them it could turn gravity off on the objects(on a rigidbody) and add force upwards causing them to float up