- Home /
How to hide an animator with sprite?
Hi all.
After 3 hours reading and reading, i post the question. How can i to hide an sprite im using with animator? I need to show the animation and hide it with buttons.
I have tried lot of things, but i can't do this! How it is posible there is not a anim.show or anim.hide ?
i'm lost Can anyone help me, please?
Please elaborate more on your question. But, according to the way I understood, you can hide the sprite by setting the transform.localScale to Vector3.zero.
Answer by tormentoarmagedoom · Jun 06, 2018 at 10:18 AM
Good day.
You have multiple ways to "hide" a image like a sprite.
You can simple Deactivate the gameobject by
gameObject.SetActive(false);
or you can disable the image component of the sprite by
gameObject.GetComponent().enable=false;
or you can move its position outsite of the camera view, or change its Alpha color to be 100% transparent.
Bye!
Your answer
Follow this Question
Related Questions
How to sync multiple animators with sprite animations ? 1 Answer
Any way to make Animation.Play take effect immediately? 2 Answers
How to swap a spriteRenderers source sprite at runtime when used by animator 0 Answers
Animator prevents changing UI Image source image 1 Answer
Animator dialog doesn't pop up when sprites are dragged 0 Answers