How can i change Gravity in an Area

How can i change the gravity for all gameobeject in a Cube Area? So if a Player or something else enter the cube they will fly in air but if the left it they will fall down ?

It depends on what you’re using. Rigidbody, Rigidbody2D, or CharacterController. Because they all have different basic implementations of gravity, but they all use Unity’s overall gravity settings one way or another.
What’s the same for all of them would be, that the change comes with entering or exiting a trigger volume around your “Cube Area”.

  • CharacterController: You have to use the Move method and might already have implemented your own gravity. change the values as needed
  • Rigidbody: set it’s useGravity to false and use your own implementation of gravity
  • Rigidbody2D. you can just set the gravityScale to some multiple of the overall gravity, even negate it