Hi I have a 2D object in which I added Animation and in Animation disable Loop time, also make disable animator with my game object is just to play when I needed. Below line is call on start function.
rubberObject.GetComponent().enabled = false;
and play this it hits some other object in on enter collider2D function.
rubberObject.GetComponent().enabled = true;
and then disable it on exit collider2D function again. It works fine for first time but when it collider again with object it doesn’t animate, the same functionality applied on second time but it doesn’t animate. I don’t know why this happen is this Unity issue or on my side Issue. Kindly help me on this. Thanks in advance.
So what, you have an animation that is supposed to play during a collision? Any more information you can give will help. Also, you need to pass a type to [GetComponent][1], GetComponent(Type type); or call it GetComponent<type>(); [1]: http://docs.unity3d.com/Documentation/ScriptReference/Component.GetComponent.html
– Spinnernicholas