Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to set different gravity for 2 players game ?

Discussion in 'Editor & General Support' started by blackant, Mar 4, 2020.

  1. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    Well, everything is in the title.

    i'm in that situation were i would like to simulate different gravity when 1 player enter water, but if set this effect by changing the gravity, it will also affect player 2 , and maybe player 2 is not inside water...

    so, i'm wondering what can i do to solve this aspect ?
     
  2. Gordon_G

    Gordon_G

    Joined:
    Jun 4, 2013
    Posts:
    372
    Gravity is a global setting, so you can't change it on individual objects. To make one object fall faster you need to apply a force in the direction of gravity to that object. To make it fall slower you can apply a force in the opposite direction of gravity, or increase drag, or both.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  4. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    thanks, i have set a behavior on trigger wich apply a force to the gameObject.