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.
  2. Dismiss Notice

GameObject with rigidbody slowed down if "Use gravity" is tagged?

Discussion in 'Physics' started by VladDerGauner, Feb 15, 2021.

  1. VladDerGauner

    VladDerGauner

    Joined:
    Dec 3, 2015
    Posts:
    21
    I have a simple cube on a plane and I want to move it using AddForce(). However if "Use Gravity" is tagged it seems to be slowed down, or grounded and accelerates very slowly. Why is that exactly? Shouldn't the acceleration of the object moving forward be independent of the gravitational force?

    Thanks in advance!
     
  2. AlTheSlacker

    AlTheSlacker

    Joined:
    Jun 12, 2017
    Posts:
    326
    Check your physics materials for both the plane and the cube. If you have gravity and mass there will be a force acting downwards. If you have not assigned a physics material to your colliders, then Unity will use the default (I believe it is 0.6, 0.6, 0 bounce, average, average). Your object will be affected by friction. Make your own with all zeros and apply it to both objects.

    The rigidbody will also be slowed by any drag values you have set on it. If you set drag to zero and friction to zero, any force that gets it moving will have the body moving for ever.
     
    VladDerGauner likes this.
  3. VladDerGauner

    VladDerGauner

    Joined:
    Dec 3, 2015
    Posts:
    21
    Thanks! That was exactly it. (I only had a physics material on the Rigidbody with friction set to zero.)