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

GameObjects change position on Play

Discussion in 'Physics' started by noobity, Jul 6, 2015.

  1. noobity

    noobity

    Joined:
    Jun 10, 2015
    Posts:
    8
    Hi guys, I'm having this issue with my game where my 2d objects suddenly change position on Play. In my 2D scene I have a top down sandbox playground sort of thing built, with north south east west walls and a ground, and 2 balls resting in the middle of the ground (0, 0, 0). The weird thing is that on Play, the 2 balls will suddenly snap to the nearest wall, if I position a ball closer to the north wall (0, 1, 0), then it will snap to that wall while the other ball might snap to a different wall that it is closest too. I don't have any scripts attach to my balls or the ground. The balls have a Sprite Renderer, RigidBody2D, and CircleCollider 2D attached.

    I've been stuck on an annoying issue for quite a bit of time, looked everywhere online and haven't found a solution to my problem. Any help would be greatly appreciated thanks!
     
  2. noobity

    noobity

    Joined:
    Jun 10, 2015
    Posts:
    8
    Have narrowed the problem down to the circle collider, but have no idea why it would cause that
     
  3. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    Post an example project for us to take a look.
     
  4. noobity

    noobity

    Joined:
    Jun 10, 2015
    Posts:
    8
    Ah I got it, had to do with the BoxCollider on the ground, thanks a lot!
     
  5. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    Couldnt have solved it without me ^_~
     
    JamesLeeNZ likes this.