Howdy. I'm building a simple 2D scene with a navigation mesh, a player, and an npc. I've set the anchor for the player and npc sprites to the bottom middle, and set the sprite positions to (0, 0, 0).
At runtime, this works just as expected for the player, but the npc is misbehaving. Some seemingly arbitrary transformation is being applied to the sprite, setting its position to (-1.28, -3.16, 0). Even if I try to change this by switching back to the Scene tab and editing the value directly, it changes back instantly. By contrast, I am able to edit the scale in this manner without the change being overwritten.
Bottom line - is the engine applying a position transformation to the sprite within a 2D npc? If so, what is the intention behind it and can it be turned off?
Thank you to anyone who can help.
Comments
Is it that the sprite child is being affected, while the "root" gameObject (with the NPC script) is in the correct place? It may be that this is a Sorting Map issue - if you have a FollowSortingMap applied to the NPC, disable it and see if that solves the issue. That won't be the solution, of course, but it'll help locate the source of the problem.
Another thing to try: re-enable (or just remove completely) the Follow Sorting Map component, but disable the "Follow Sorting map?" checkbox beneath it.
Did you Crack this issue? I am facing similar problem to this, my NPC is facing down left by default but when I play, he changes facing angle for no reason, I really don't know why?
Thanks in advance!!!