I have to be missing something here. The tutorial states to make a NPC with a circle collider. Done. Now I want to make the NPC a hotspot (clickable). I follow that tutorial as well. The issue is that the mouse has to scroll over the circle collider for the cursor to recognize the character as a hotspot. The circle collider is placed at the feet of the NPC and if I mouse over the body, the hotspot doesn't work.
If I add another collider like a box collider, when the NPC turns the Y rotation changes and this also changes the additional collider's y-rotation making it useless. This doesn't happen if I place the box collider on the sprite object, but then the NPC script is on the parent object and it no longer works for hotspot detection.
This post illustrates the same problem:
http://answers.unity3d.com/questions/603186/is-it-possible-to-rotate-a-boxcollider2d.htmlHow are you guys setting up clickable, moveable NPCs in 2D with adventure creator? Circle colliders seem unaffected by a Y rotation in 2D. All other colliders are.
Comments
This'll be a critical issue - anyone with 2D NPCs working pre-4.6 got this now?
I get the exact same behavior in 4.5.5. I retested adding the collider to a sprite and it doesn't work as a hotspot. I also noticed that my main character's circle collider also rotates incorrectly with the usage of rotating the y axis.
The 2D demo does not seem to use anything that would show this issue originally. Is there a specific reason we are rotating y in 2D besides consistency with 3D?
Interesting read: http://forum.unity3d.com/threads/unity-4-5-2d-colliders-rotation-change.248890/
I will look into the suggestion that a Rigidbody2D is necessary, though.