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 Create Enemy Navigation and AI

Bird stop chasing

When I go to the back of the bird, at some point, the bird will stop chasing me. I wonder if anyone has the same problem and how to fix it?

1 Answer

Wesley Trayer
Wesley Trayer
13,812 Points

Yes, it's not really an error, if you check the collision bounds of the bird, you'll see it's composed of two parts: a cylinder and a box. The cylinder is around the bird's feet and the box protrudes in front of it, but nothing extends out behind it. The bird has a relax distance when it gets near the player, so it doesn't overrun the frog. That means that if you get behind the bird, and are inside the relax distance, the bird won't chase you.

I have exploited that before, it's a fun trick. Hope this explanation is clear.

Wes

Ohhh I now understand, thank you so much! I have tried to change the relax distance, it's pretty okay now!