Search Unity

Collision detection goes wrong when object is not in the center of the screen

Discussion in '2D' started by unity_iaGvAVLgpYvM5Q, Feb 18, 2020.

?

Collision detection goes wrong when object is not in the center of the screen

  1. ....

    0 vote(s)
    0.0%
  2. Thank you

    0 vote(s)
    0.0%
  1. unity_iaGvAVLgpYvM5Q

    unity_iaGvAVLgpYvM5Q

    Joined:
    Dec 20, 2019
    Posts:
    2
    Hey. I'm totally new to unity, I was following tutorials to add collider2d to game object, but either I did something wrong or missed something. Anyways.. I have a boat gameobject in 3D space which slowly moves from right to left of the screen. Boat has a collider2d attached + rigidbody2d. Also I have another gameobject, a Bubble, that represents the mouse. Bubble also have a collider2d. When Bubble is over a Boat, Boat will perform some action. Now to the point. When Boat is closer to the screen center collider works perfectly. But as soon as the boat moves away from the center to the left or to the right, in order to trigger collision, bubble have to be further from the center then the boat. And the further the boat is to the screen edge , the further I have to place bubble pointer in order for it to work. Please help if anyone faced similar issues. Even fresh idea would help...

    upload_2020-2-18_9-0-45.png
     

    Attached Files:

  2. unity_iaGvAVLgpYvM5Q

    unity_iaGvAVLgpYvM5Q

    Joined:
    Dec 20, 2019
    Posts:
    2
    Nevermind, sorted
     
  3. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    BTW - You were looking for free help to YOUR problem - so it would be nice if you shared the solution - what was wrong - it doesn't matter if it was something "silly" as someone else might be stuck with the same problem later...