Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 03, 2014 at 11:38 AM by meat5000 for the following reason:

Do tutorials. Read the Manual.

avatar image
0
Question by naresh.khatri · Aug 03, 2014 at 06:10 AM · animationcharactermoveaddwalking

how to add a walking animation when character is moving?

Hi guy, im new to unity 3d and i have a problem . i have a zombie prefab and a walking animation.i want to add that animation when my zombie is moving.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Aug 03, 2014 at 11:39 AM 0
Share

Drag the prefab into scene. Add your animations, relevant animation component and script.

Drag the Hierarchy GameObject you created Back in to the project manager to create a new prefab with your newly set up character.

3 Replies

  • Sort: 
avatar image
0
Best Answer

Answer by thornekey · Aug 03, 2014 at 06:52 AM

Hi, welcome to unity :)

You can make your player animate when moving like this:

     public float stopAnimation = 0.5f;
    
     var directionVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
         if ((directionVector.x > stopAnimation || directionVector.x < -stopAnimation) ||
                 (directionVector.y > stopAnimation || directionVector.y < -       stopAnimation) ||
            (directionVector.z > stopAnimation || directionVector.z < -   stopAnimation)) {
             animation.Blend("YourAnimationNameWalk");
          } else {
             animation.Blend("YourAnimationNameIdle");
         }

I suggest you read up on what this actually means. Its quite simple, and basic to read. Good Luck.

Remember to check the reference page for quick tips and solutions.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Firedan1176 · Aug 03, 2014 at 07:42 AM

You can also use Unity's Mecanim to sort of visually "program" your animations and parameters to toggle between animations on a player. You can find more here.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by $$anonymous$$ · Aug 03, 2014 at 11:25 AM

Whoa whoa whoa, misread I thought we were talking about the player... In any case you would use the Animator Component and Move Towards Component...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Random location when clicked on 1 Answer

Making Character Stand? 1 Answer

how to make a character Animation walk,idle,Attack and death ? its should do all these things 2.5 Isometric way. 0 Answers

3D character Animation 0 Answers

animating a character model 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges