Question by
BCrisos · Apr 23, 2016 at 08:45 PM ·
scripting problemanimatorparentanimator controllerchild object
How can you animate an object thats not the child of an animator?
Is there a way to animate an object that's not a child of the animator. For instance, I've made a sprite fade in and out while being a child of the animator, I decided to move it else where to a new parent. Can I still use the animator and the animation from before to function like it did via code? I've tried to access it via unity inspector but I had no luck. Here is my code:
public GameObject nispress; public Animator npress; public Animation noteagai; bool npressed;
// Use this for initialization
void Start () {
npress = GetComponent<Animator> ();
noteagai = GetComponent<Animation> ();
nispress = GetComponent<GameObject> ();
}
Comment