Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare an AnimationClip variable named clip.
Unity
AnimationClip [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that is not descriptive or confusing.
✗ Incorrect
The variable name for the AnimationClip is clip.
2fill in blank
mediumComplete the code to create a new AnimationClip instance.
Unity
AnimationClip clip = new [1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect class names like Animation or AnimatorClip.
✗ Incorrect
To create a new AnimationClip, use new AnimationClip().
3fill in blank
mediumFix the error in the code to assign the clip to the Animation component.
Unity
animation.[1] = clip; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing with Animator properties like runtimeAnimatorController.
✗ Incorrect
The legacy Animation component has a clip property to assign an AnimationClip directly.
4fill in blank
hardFill both blanks to create a dictionary mapping animation names to clips.
Unity
var clips = new Dictionary<string, AnimationClip> { {"Run", [1], {"Jump", [2] }; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up clip variable names with animation names.
✗ Incorrect
The dictionary keys are animation names and values are the corresponding AnimationClip variables.
5fill in blank
hardFill all three blanks to create an AnimationClip, set its frame rate, and add a curve.
Unity
AnimationClip [1] = new AnimationClip(); [1].frameRate = [2]f; [1].SetCurve("", typeof(Transform), "localPosition.x", [3]);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names or wrong frame rate values.
✗ Incorrect
Create a clip named clip, set its frame rate to 30, and add an animation curve named animationCurve.