Gravity Controller

Hey, just needed to ask something, so in my game I want to make a certain place low gravity. Do you guys know how to make this low gravity effect work? This would be very helpful.

Place a collider in that area, make it a trigger by checking the box “Is Trigger” in the inspector. Then attach a script that has an OnTriggerEnter or OnTriggerStay function. Then you would use Physics.gravity to control the gravity via script. In this script, to detect your player:

void OnTriggerEnter(Collider other)
{
    if(other.collider.gameObject.tag == "Player")
    {
        Physics.gravity = Vector3.zero;
    }
}

//Then when you exit this area

void OnTriggerExit(Collider other)
{
    if(other.collider.gameObject.tag == "Player")
    {   
        Physics.gravity = new Vector3(0, -25, 0);
    }
}

My example is in C-sharp. The links I posted have JavaScript and C-Sharp Examples.

If you want only certain objects to have low gravity, have a look at rigidbody.useGravity