Dear Unity Community,
I’m struggling with the following problem:
I’m creating a quizapp (with the help of a tutorial on youtube: https://www.youtube.com/watch?v=HWCFJP6C4bk&t=3s)
So I wanted to extend the functionality with images/sprites. Images in questions work quite nice. But I also want to add pictures to a possible answer. Now I am at the Point, where I can not access the Animator inside the Answer Prefab. The following warning appears:
I set up the Animator correct. But my code can’t access the animator State.
answerImageStateParameterHash = Animator.StringToHash("AnswerImageState");
answerData.answerImageAnimator.SetInteger(answerImageStateParameterHash, 1);
As you can see I want to Call a ImageObject that is a Child of MyPrefab:
I already read about this problem, but can’t find a solution for myself. And I’m trying about 2 weeks to solve it…
My thought is that I need to Call the Animator, when the prefab is instantiated. But I couldn’t figure out how?
I hope that anyone can give me an solution or an advice how to handle this problem.
I have uploaded the scripts on Github. I hope this can give you an impression.
https://github.com/Gabo0890/QuizGame.git
Kind regards,
Gabriel