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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Animation and box collider

Discussion in 'Animation' started by Captainfrasse, Mar 19, 2016.

  1. Captainfrasse

    Captainfrasse

    Joined:
    Jun 29, 2015
    Posts:
    3
    Hello.
    My character is falling throw the ground half way so his legs are under the ground but the box collider 2D is on the right position. Bug.JPG
     
    UnmatchedSocks likes this.
  2. 5vStudios

    5vStudios

    Joined:
    May 9, 2015
    Posts:
    106
    You need to set the BoxCollider2D to match the height character, looks like it is based at its neck.
     
  3. Captainfrasse

    Captainfrasse

    Joined:
    Jun 29, 2015
    Posts:
    3
    When i start the game the BoxCollider2D goes down to the neck but when it is not in play mode it is in the regular spot. Bug.JPG
     
  4. 5vStudios

    5vStudios

    Joined:
    May 9, 2015
    Posts:
    106
    have you ensured that the collider on the floor is also positioned correctly ?
     
  5. UnmatchedSocks

    UnmatchedSocks

    Joined:
    Mar 24, 2016
    Posts:
    3

    I kinda messed up in the middle
     
  6. UnmatchedSocks

    UnmatchedSocks

    Joined:
    Mar 24, 2016
    Posts:
    3
    what site do you do to make this game or in general your own game?
     
  7. RemDust

    RemDust

    Joined:
    Aug 28, 2015
    Posts:
    431
    The problem seems to be that your collider is not animated with your sprites.
    You should check your pivot points so the different frames are perfectly aligned and then animates your box collider with each frame (in the animation panel).