How to code to make enemy play walk Animation while moving and attack animation while near player?

I cant see any tutorial for this all the tutorial shows only about moving but never with animation stuff so how to do this ?

Hmm, I see 18 tutorials in the official Animation Tutorials section. Are you sure none of these show you how to do this?

but the link you gave is just about how to create animation , i already made animation now i want it to play while moving like walk animation but how its an ai so he should move with animatiion so how to do that?

1 Like

Sorry, I’m still skeptical. The second section there is “Controlling Animation,” which is all about how to play animations when you want to. There are six tutorials in that section. I’m pretty confident the answers you seek are there.

If video tutorials aren’t your thing, then go read the manual (here and here for example). What you’re asking doesn’t have a simple answer — you have to learn how to use the animation system, and Unity has already written many pages and produced hours of video showing you how to do that.

1 Like

Thnaks and just asking is event syestem is really hard iam watching the tutorail series where basic scripting are easy but thing like event are so complicated like menu making

No, I think the event system is quite easy. I use it for almost everything… I even made my own tutorial about it.

1 Like