Search code examples
unity-game-engineanimationscale

why Prefab displayed larger than default when apply Idle animation?


uncheck animator:

enter image description here

after check animator:

enter image description here

the Animator: enter image description here

the Block Prefab with Animator: enter image description here when i drag one block to other same number block,then trigger the merge animation, which scale up block and then scale to normal, but before apply merge animation, the block displayed larger than default when idle animation.

At first I doubt that the merge animation could result in the block bigger so i change the merge animation from scale up to down, but same result, the problem is that I have not triggered merge action!!!

the wierd is that the prefab will display normal size if it was located in hierarchy. if the prefab was created by C# code , it will displayed larger than normal size!!!

the scale of prefab created by c# code was equals to prefab that was located in hierarchy!!! Their values are equal to 1,but display size are different

enter image description here enter image description here

I want to keep the same size of my prefab before apply merger animation when animator is in Idle state!!! appriciate any advise, please tell me how to keep the original size when gameobject in idle aniamtion

gameObject = GameObject.Instantiate(prefab, pos, rotate);

Solution

  • Try with adding them directly to game. Not in Window in game, GamePanel as child.