I am doing one mini game in unity 3d,in which I have door animation, I created door sprite in inspector,Now my question is when i click that door that needs to open,and I used object Instantiate method,[players = (GameObject) Instantiate(playerPrefab, new_size, Quaternion.identity);] but I think this is not a suitable method to do because it create dublicate copy of door that is why,if there are any other idea please reply
Share
You need to have the texture stored as a variable in you class. Then you shall call a method(For example a IEnumerator or you can use a if statement in Update()) Then insert the code from SPrite Animation from wiki.unity3d.com into your Class(class.cs).
or you can insert an if statement into the Update Method in the Sprite Animation and turn it to true when you want to call the animation.