Search Unity

Question 2D Rigidbody?

Discussion in 'Getting Started' started by unity_010736, Aug 11, 2023.

  1. unity_010736

    unity_010736

    Joined:
    Jul 27, 2023
    Posts:
    9
    I am extremely new to Unity and am trying to create a 2D platformer for a project. I have used a free tilemap asset and an different 'college student' asset (I need it as it is the only free asset that matches the theme). How do I apply RigidBody 2D without everything falling when the game starts? Especially unsure since I don't really know what a tilemap is.
     
  2. Kioxile

    Kioxile

    Joined:
    Aug 15, 2023
    Posts:
    1
    Hi, Welcome to the forums! you are going to want to go to the inspector of those objects and click add component ""Rigidbody 2D." Then under that module in the inspector, set the gravity scale of anything you don't want to be subject to gravity to "0." I would also check the x,y, and z boxes under constraints -> freeze position/rotation in the rigidbody 2D inspector for any wall or ground that you don't want to move when something collides with it. BTW, you can mass edit this process if you select all the objects in the heirarchy pane before you add component etc...Hope that helps!
     
    Last edited: Aug 15, 2023
    unity_010736 likes this.
  3. AngryProgrammer

    AngryProgrammer

    Joined:
    Jun 4, 2019
    Posts:
    490
    Also to the above post, not all game objects must have Rigidbody2D. If it's some platform, ground, wall, etc. Then they should have only Collider2D.
     
    unity_010736 likes this.
  4. unity_010736

    unity_010736

    Joined:
    Jul 27, 2023
    Posts:
    9
    I actually ended up using youtube, but thanks for the answers!