Time for action – creating the target
We have all the pieces; the next step is to put them together.
- Start by dragging the Target model from the Project window to the Hierarchy window. This creates a new instance of the
target
object. - By selecting the new
target
object, we can see that it already has anAnimator
component attached; we just need to add a reference toAnimatorController
that we created. Do this by draggingTargetController
from the Project window and dropping it on the Animator component's Controller field, just as with all the other object references we have set up so far. - Also, we need to add the
Target
script to the object and connect a reference to theAnimator
component in its relevant field. - The last thing to do to the target ...
Get Unity Android Game Development by Example Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.