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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Character falls on play

Discussion in '2D' started by Legendree, Jul 8, 2020.

  1. Legendree

    Legendree

    Joined:
    Jul 5, 2020
    Posts:
    3
    I am creating top-down game, my character keeps falling because of the Rigidbody 2D,
    although I have set the Physics 2D in the Project Settings to x: 0 y: 0, he still keeps falling along the Y axis.

    Any help would be much appreciated, thank you
     
    Last edited: Jul 8, 2020
  2. Legendree

    Legendree

    Joined:
    Jul 5, 2020
    Posts:
    3
    Screenshot of the Rigidbody 2D component on the player gameobject
     

    Attached Files:

  3. Mooxe

    Mooxe

    Joined:
    Sep 18, 2013
    Posts:
    19
    Are there any scripts attached to your character?
    Also try creating a new sprite and adding a Rigidbody2D to it, set gravity scale to 0, and see if the sprite falls.
     
    Legendree likes this.
  4. Legendree

    Legendree

    Joined:
    Jul 5, 2020
    Posts:
    3
    You have pointed me in the right direction, I had a polygon collider 2d on the whole world for the camera bounds, I didn't check the property Is Trigger for it and the engine physics pushed the player out of the box (because collision of course).
    now it is working as expected thank you.
     
  5. Mooxe

    Mooxe

    Joined:
    Sep 18, 2013
    Posts:
    19
    Oh cool, glad it works.