Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
avatar image
0
Question by jballew7 · Jul 03, 2011 at 08:19 PM · animationcharacterjumptransitionanimating

Switching between animations

Hi, I'm terribly stumped.... I'm trying to make simple actions for my character walk, run, idle, jump... I've imported my rigged and animated character from blender. It has a controller so when I hit play, it moves correctly.. My trouble now is that I can't get the animations to match up with the correct keys.. exp, when I hit the space bar the player moves up but doesn't perform the jump animation. When i do play and hit the arrow key it plays through all the animations I made, instead of playing the right ones that correspond to the key i hit, like jump.... I've done all the frame stuff, none of the tutorials I've tried work, Idk what to do

thx

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
1

Answer by testure · Jul 03, 2011 at 09:44 PM

Start here:

http://unity3d.com/support/documentation/Manual/Character-Animation.html

If you still don't know what to do, come back and ask a specific question about the problem you're having- because based on the question you've asked it looks more like you dove into it without reading how to do it first :)

Comment
Add comment · Show 6 · 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 jballew7 · Jul 04, 2011 at 11:10 PM 0
Share

I followed that tutorial and it worked well, but I still don't understand... In a nutshell all I'm wanting to do is make the character do the right animations at the right time. So suppose hes standing still and I press the up arrow key.. he walks forward, or If i press the space bar he jumps.. I don't understand how to make the character perform the right animation for each key pressed

avatar image testure · Jul 04, 2011 at 11:32 PM 0
Share

There are examples of how to do that on the page I linked!

In fact, there is an example that is almost EXACTLY what you're asking for on that page.

 function Update ()
 {
    if (Input.GetAxis("Vertical") > 0.2)
        animation.CrossFade ("walk");
    else
       animation.CrossFade ("idle");

     // Shoot
    if (Input.GetButtonDown ("Fire1"))
       animation.CrossFade("shoot");

 } 

So, look at that example and take a wild guess at how you would make a JU$$anonymous$$P animation..

avatar image jballew7 · Jul 05, 2011 at 12:47 AM 0
Share

Ok so Ive got it going for the most part, but I've still got a couple of problems... sry Im new to Unity and scripting plz be patient, thx for you help

one is that it performs the walking animation when pressing up/down arrow keys but not when pressing one of the left/right keys just slides across the plane, also I can only get it perform the jump animation if I set it to "Fire1" but I want to be able to use the space bar, cause that is what the controller is using to make it jump.. it says that Input Button space is not setup,

this is the script Im using I just edited it to try and fit

function Start () { // Set all animations to loop animation.wrap$$anonymous$$ode = Wrap$$anonymous$$ode.Loop; // except jump animation["jump"].wrap$$anonymous$$ode = Wrap$$anonymous$$ode.Once;

// Put idle and walk into lower layers (The default layer is always 0) // This will do two things // - Since jump and idle/walk are in different layers they will not affect // each other's playback when calling CrossFade. // - Since jump is in a higher layer, the animation will replace idle/walk // animations when faded in. animation["jump"].layer = 1;

// Stop animations that are already playing //(In case user forgot to disable play automatically) animation.Stop(); }

function Update () { // Based on the key that is pressed, // play the walk animation or the idle animation if ($$anonymous$$athf.Abs(Input.GetAxis("Vertical")) > 0.1) animation.CrossFade("walk"); else animation.CrossFade("idle");

// jump if (Input.GetButtonDown ("space")) animation.CrossFade("jump"); }

avatar image testure · Jul 05, 2011 at 02:36 AM 1
Share

Look, we can keep going back and forth like this forever- but at the end of the day you lack sufficient knowledge to do what you're trying to do, despite having the resources right under your nose. It's not your fault, you're just trying to start in the middle rather than learn the basics and work your way up.

You need to start from zero and learn the basics before jumping into whatever it is you're trying to do. Otherwise you're going to be posting a question here every time you run into something you dont understand (which will be very frequent).

Here's my suggestion- download the Unity 3D Platformer tutorial and do it. $$anonymous$$ake sure you read and understand every word before turning the page. Don't just copy and paste the code, then move on to the next step- that's not how you learn. It's a really good tutorial and you will learn a ton from it if you take the time to understand the things it's trying to $$anonymous$$ch you.

http://unity3d.com/support/resources/tutorials/3d-platform-game.html

Sorry if this came off as harsh- but it's reality. And if you take my advice, you will gain the knowledge you need to understand how to work with unity.

avatar image testure · Jul 05, 2011 at 04:39 AM 1
Share

Also- I'm not trying to bring you down or anything, just trying to explain that you're going about things the hard way. If you want to gain a better understanding, try the tutorial again, and anything you don't understand, post a question about it- people will be more than happy to explain whatever is tripping you up, trust me!

Just make sure you understand everything before moving on- that's important. Everything you learn builds off of something else- so if you skip something or just glaze over it, you're in for some trouble in the future.

good luck!

Show more comments

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Loop animation until character reaches hit.point 1 Answer

Animation State issue 2 Answers

Minor Addition to Jumping using CharaterController 1 Answer

Transition from jump to walk animation. 1 Answer

How to create animations for rigged character? 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