Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Game Development How to Make a Video Game Score, Enemies, and Game State Add a Start and End

Bird moves towards frog before the game is started

The bird moves to my frog before the game starts but it doesn't eat the frog. I get this error in the console:

UnassignedReferenceException: The variable target of BirdMovement has not been assigned. You probably need to assign the target variable of the BirdMovement script in the inspector. UnityEngine.Transform.get_position () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineTransformBindings.gen.cs:20) BirdMovement.Update () (at Assets/Scripts/BirdMovement.cs:21)

In the inspector window for bird, the bird movement target variable has "Player (Transform)."

3 Answers

This bird behavior is called "pre-game intimidation." It's common amongst competitors and rivals. Birds will be birds. (Just kidding.)

This bird behavior is called "pre-game intimidation." It's common amongst competitors and rivals. Birds will be birds. (Just kidding.)

Carlos Vieira
Carlos Vieira
3,081 Points

For some reason it creates two objects on the bird, take a look on the Unity there. So remove one, and then draw the bird again to the Game Manager Bird Movement.