Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feature Request Gravity by Rigidbody, sleep state counter and more option by PhysicScene

Discussion in 'Physics' started by Helvest, Aug 27, 2023.

?

Do you need Unity to expose one of those PhysX features?

  1. Gravity force/direction by rigidbody

    100.0%
  2. AddForce as a gravity force (don't reset sleep counter)

    100.0%
  3. Get Rigidbody sleep counter

    100.0%
  4. Get Rigidbody energie and energie formula

    100.0%
  5. Custom Settings by PhysicScene

    100.0%
Multiple votes are allowed.
  1. Helvest

    Helvest

    Joined:
    Oct 1, 2016
    Posts:
    2
    Hello, I'm posting this message to highlight an annoying limitation that prevents good performance with PhysX in Unity.

    I'm talking about the gravity setting. In Unity it can only be activated or not by rigibodies, and the direction and force of gravity are the same for all.

    However, I'm currently coding a game in space, with mini-planets (something between Mario Galaxy and Outer Wilds).

    And so I'm obliged to manually apply a gravity calculation with the function AddForce(gravityDirectionalForce, ForceMode.Acceleration) to lists of rigidbodies.

    The problem is that this prevents the rigibodies from falling asleep.

    There's no function to apply a force that will be treated in the same way as the force of gravity.

    I know that in PhysX, each rigibody has a sleep counter, which is counted down whenever the rigibody's energy falls below a certain limit and goes to sleep when it reaches 0.

    But this limit is useless, if you're constantly applying force to the object, any AddForce, Move, or direct velocity set functions will reset this counter.

    In short... So I'd like to understand why these limitations? If most of these limitations are only caused by the fact that certain PhysX API variables and functions are not exposed, why this choice?

    And would it be possible for an update to expose them?

    And also allow the set of physic setting for additional physical scenes?
     
    arkano22 likes this.