• 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 /
avatar image
0
Question by smithr3339 · Oct 23, 2013 at 10:12 PM · animationanimatorfpsarms

How to make animator do run/walk animations

I have some FPS arms and all the animations set up in an ANIMATOR CONTROLLER. How can I check to see if the person in holding down shift, the run animation plays? Also if you know how can I make it so when they push shift their speed goes up? C# if possible

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by darthbator · Oct 23, 2013 at 10:51 PM

You would want to do something like this inside update.

 if (Input.GetKeyDown(KeyCode.LeftShift)) {
 //do setup for increased player speed
 }
 
 if (Input.GetKeyUp(KeyCode.LeftShift)) {
 //do setup to return to player baseline speed/animation
 }
Comment
Add comment · Show 2 · 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 smithr3339 · Oct 23, 2013 at 10:53 PM 0
Share

Thanks! But what is the command to access my animation called "run" in my animator?

avatar image darthbator · Oct 24, 2013 at 01:02 AM 0
Share

This depends on the animation system you are using. Legacy or mecanim

In the animation system (legacy) you just call Play("animName") or Play(animationClipObject). With mecanim you'll most likely want to edit a variable inside the mecanim state machine.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Can I combine animation of different objects 0 Answers

AnimationEvent has no function name specified 2 Answers

How do I add the animation to my player in Unity 4? 1 Answer

Multiple Weapon Animation Help 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges