Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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

Discussion in 'Getting Started' started by badassgamer, Apr 25, 2016.

  1. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    I cant see any tutorial for this all the tutorial shows only about moving but never with animation stuff so how to do this ?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    Hmm, I see 18 tutorials in the official Animation Tutorials section. Are you sure none of these show you how to do this?
     
  3. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    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?
     
    SAMYTHEBIGJUICY likes this.
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    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.
     
    badassgamer likes this.
  5. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    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
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    No, I think the event system is quite easy. I use it for almost everything... I even made my own tutorial about it.
     
    Tset_Tsyung likes this.