SetTrigger expects a string parameter name in quotes.
Step 2: Identify error in code
Attack is used without quotes, so it is treated as a variable, causing error.
Final Answer:
Attack should be a string in quotes -> Option B
Quick Check:
Parameter names must be strings [OK]
Hint: Always quote parameter names in SetTrigger [OK]
Common Mistakes:
Forgetting quotes around parameter
Using wrong method for trigger
Assuming Attack is variable
5. You want to create a smooth transition between walking and running animations based on player speed. Which animation parameter type should you use and how should you update it in code?
hard
A. Use an int parameter named SpeedLevel and set it to 1 for walking, 2 for running.
B. Use a bool parameter named IsRunning and set it true when speed > 0.
C. Use a trigger parameter named RunTrigger to start running animation.
D. Use a float parameter named Speed and update it with the player's current speed value.
Solution
Step 1: Identify parameter type for smooth transitions
Float parameters allow gradual changes, perfect for blending animations by speed.
Step 2: Update parameter with player speed
In code, update the float parameter with the player's current speed value to control animation blending.
Final Answer:
Use a float parameter named Speed and update it with the player's current speed value. -> Option D