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

Please help me make gravity unity3d

Discussion in 'Physics' started by derekli21870, Sep 10, 2020.

  1. derekli21870

    derekli21870

    Joined:
    May 10, 2020
    Posts:
    6
    Sorry, I'm new to unity how do I add gravity to my camera when I add a rigid body the gravity works but it doesn't detect a collision. I want the gravity to stop when the camera hits something

    update: the gravity works on other objects, not the camera
     
    Last edited: Sep 10, 2020
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,533
    Without a collider it'll not collide with anything so you need to do that.
     
  3. derekli21870

    derekli21870

    Joined:
    May 10, 2020
    Posts:
    6
    But how do i get a collider
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,533
    You don't state if you're using 2D or 3D physics but colliders are components just like the Rigidbody or Rigidbody2D you added. There are 2D and 3D ones.

    Sounds like you should follow a basic physics tutorial such as this. In short, Rigidbodies move and colliders attached to them specify areas/volumes that should interact.
     
    Last edited: Sep 10, 2020
  5. derekli21870

    derekli21870

    Joined:
    May 10, 2020
    Posts:
    6
    Thanks