Hello, I'm studying AC following the various tutorials.
I have found two oddities:
in the 2d demo, when creating the box collider and hotspot of the bird a popup warns me that these two components must be placed on the sprite child and not on the root object. But in my case the message is incorrect because everything runs smoothly on the root object. If I use the sprite child, hotspot is only found on the sides as if the circle collider would cover the hotspot.
The other oddity is that by setting the sprites sorting layer as suggested by the demo Brain remains under ParkGround that instead it must be set between -4 and -1 ( instead of 0, while Brain stays at 0).
I misunderstood something?
Unity Personal 5.3.0f4 and AC 1.51d
Thanks
Valter
Comments
NPC component
The NPC script / trigger collider should normally go on the sprite child because it will always be facing the camera, whereas the root object will be rotating in 3D space. The bird in the demo can have them on the root because it's uni-directional - it doesn't rotate over the course of the game.
The Circle Collider and Box Collider can occupy the same space - but the Box Collider (which the NPC script makes use of as the "click area" must have "Is Trigger" checked.
Sorting layer
Brain's Order in layer should only be either 1, 3 or 6 as he moves around the scene when the game is running as he follows the Sorting Map. Is he 0 for the whole time in your scene? You can try playing the 2D demo online to see if there's a difference.
Sorting Layer
If two sprites are on the same Order in layer, and same depth from the camera, then Unity seems to pick which one to display first at random. The SortingMap takes care of this issue, but you can just set Brain's layer to 1 in the meantime to ensure he's above it.
NPC component
Apologies, I was confused because I thought you were referring to the 2D Demo. The NPC component should be on the root, but the Hotspots (and Box Collider 2D trigger) shoult be on the sprite child. This was because Unity made a fundamental change to the 2D physics system after the tutorial was published. Don't forget that you can also use the Character Wizard to have AC place the components for you.