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 /
avatar image
0
Question by Nick 22 · Mar 04, 2011 at 01:22 PM · gunshootreloadidle

Reload/Shoot Animation

Hi All,

I know this question has been asked for a lot of times, but for me most of the answers are a little unclear.

I want to be able to use animations in Unity3D. So most people advised to create the animations in 3D Studio Max, as that is the program I used to create my gun.

Okay, no problem. I animate that gun beautifully :P, but still no info on how to add this in Unity. On another thread, someone mentioned that I would have to call the animation upon the reload button is being pressed or the ammoclip is empty. I understand that, and I think it would be working just fine, if I knew how.

I just need to know how to name my animations in Max so I can call them as an event in Unity 3D.

Or do I need to save my animations in 3 different files? (Idle, Shoot, Reload) That might slow it down, I think.

Anyway, could you point me into the right direction of naming my animations in Max or Unity 3D?

Cheers!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bablo · Mar 04, 2011 at 01:47 PM

You need to know which frames in 3dsmax are used for which animation, for example, if you have the shooting animation in 0-20 and the reload in 21-40. Then when you import the model to unity, you need to tell unity, which frames have which animation, in Inspector->(FBXImporter)->Animations.

Then, when you have added all the wanted animations in there, you can see the animations in your project tab with their corresponding names. Now you can go to your character/weapon and add the animations through the inspector. When you have added all the animations you need, you can call them for example with a script like this(that one is just from one of my characters, but you get the point):

if(Input.GetAxis("Vertical")!=0 || Input.GetAxis("Horizontal")!=0)
{
     animation.Play("run");
}
else
{
     animation.Play("idle");
}

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 Kashaunzilla · Apr 17, 2011 at 04:44 PM

Well if you are trying to name the animations split them up and import everything to unity and then you can rename them from there instead of having them animation, animation1, and animation2.

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 sunil1 · Jun 23, 2016 at 02:11 PM

Publilc AnimationClip Walk; ppublic AniamtionClip idle; Public Animtion An; Public Rigidbody Rb;

void Update {

if(Input.GetAxis("Vertical")!=0 || Input.GetAxis("Horizontal")!=0) { animation.Play("run"); } else { animation.Play("idle"); } } public void playAnim(string animName) { an.CrossFade(animName); } public void stopAnim() { an.Stop (); }

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

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

1 Person is following this question.

avatar image

Related Questions

Reloading script 1 Answer

Wrote a script for Shooting, reloading and to display the AMMO in a GUIText 1 Answer

No Reload Script Works 1 Answer

How do I make a gun project a particle? 1 Answer

arms with gun and animation 1 Answer


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