Forum rules - please read before posting.

Sprite child not positioned at 0,0,0 warning

Hi,

I get this console warning:

 The sprite child of '[NPC]' is not positioned at (0,0,0) - is this correct?
 UnityEngine.Debug:LogWarning(Object, Object)

for every 2D NPC whose root object has been dragged away from 0,0,0 to place it in the scene even though the sprite child's position is still 0,0,0.

For example: start new Unity 2D project, import AC, load 2D Demo Park scene, drag 2D Demo Bird prefab into hierarchy, reset Bird root transform, reset Bird sprite child transform, hit Play, stop Playing, no warning about sprite child position. Bird root position is 0,0,0. Bird sprite child position is 0,0,0.

Now drag Bird root object (not sprite child) into the place where I want it in the scene. Bird Root object position is whatever I dragged it to. Bird sprite child position is 0,0,0. Hit Play, get console warning about sprite child position.


Am I doing the placement wrong? I followed the Making a 2D Game video tutorial but as a Unity noob I don't know if I've missed something important. Is it OK to ignore the warning if the NPC is going to stand in one place all the time?

Thanks in advance



Comments

  • This issue was fixed in v1.49a - please upgrade if you haven't already.
  • I'm now getting this message again all of a sudden out of nowhere on 1.55a. Seems to happen when packing sprites with the Sprite Packer. Is it safe to ignore this?
  • Yes, it's more of a warning for those not familiar with how AC works.  If it looks right in your game, ignore it.
  • Sorry to open up an old thread but unless I enter a negative value for the sprites Y transform, the player is walking "on top" of the nav mesh. To try and avoid the warning I tried to reposition the circle collider on the Player but it doesn't seem to have any effect.

    Unless I'm missing something, would it be possible to add a checkbox in settings to hide this warning? The warnings keeps popping up for all the characters in our game :smile:

  • The sprite child really should be at (0,0,0) unless you have a really unique reason for otherwise.

    The correct way to change a sprite's position relative to the character's root is to change the Pivot position in the sprite's Inspector.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.