Hi all,
I followed the youtube 2d tutorial and try to add an NPC as exercise. I found a lot animations on unity assetstore have only two directions. So I choosed one from here: https://assetstore.unity.com/packages/2d/characters/isometric-character-dog-302332
Now, I got two questions:
How can I set the NPC with only front and back animations?
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-07_06-01-04.webp
And how to set the NPC sort layer of the NPC?
I can not let the NPC set on the park bench, it always behind the bench. Though I have set the "pivot" on "Sprite Sort sorting" and also added the sorting group.
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-07_05-45-19.webp
Thanks very much for the help!
Conny
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
In AC's terminology, "Up" and "Down" are what it calls "Back" and "Front". You can check the Up and Down, and uncheck the others, to have it only face those directions.
However, your character uses the "Sprites Unity Complex" character animation - not the "Sprites Unity" animation option that the video tutorial covers.
With "Sprites Unity", animations are played automatically based on naming convention. So "Idle_D" for down/front etc.
With "Sprites Unity Complex", animations are instead played with Animator transitions based on parameter values - the more usual way of working with animation in Unity. AC will update parameter values automatically.
For example, the "Direction integer" - if set - will be set to the character's facing direction represented as a single digit. The Manual's "Character animation (Sprites Unity Complex)" chapter covers this in more detail, but this value will be 0 for Down/Front and 3 for Up/Back.
Hi @ChrisIceBox Thanks so much for the clear answer of the question.
But can you also take a look for my second question: why my dog is always behind the park bench?
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-07_17-14-28-1.webp
I use the "character wizard" created the NPC (dog), and try to put it on the "ParkBench" , however, it doesn't work, it always behind the bench...
What I have done is:
Dog Sprite:
Sprite Rendere
component onDog
Sprite , set the Sprite sort point toPivot
Sorting Group
component to Dog SpriteGlobal Settings for Unity 6 Urp.
https://www.codehamster.com/wp-content/uploads/2025/05/2025-05-07_17-25-37.webp
@ChrisIceBox I think, I found the problem, I should set the sprite center of the dog to the "bottom center" in sprite Editor. However, the Dog Sprite is made a lot of images. I changed only the first slice pivot.
So, the solution will be change all pivot of the slided images to bottom center... But I have no idea how to set one time all the pivot of the slided images to bottom center... I know this is not the topic of AC...
But hope you can give me some suggestions.
Again, it's me, problem solved. You just need to re-slice the sprite and set it pivot at bottom. The only problem is the old animation will broken...
Animation in unity is a nightmare...