• 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 Paparakas · Sep 09, 2013 at 07:02 PM · animationmecanimaimdownsights

How do I make an aim down sight animation that can be used with mecanim?

I'm trying to animate a gun, and I can make every animation externally.. Except the aim down sights animation. I could use scripts or animate it in unity itself, w$$anonymous$$ch is what I just did, but it turns out it won't be compatible with mecanim. So I need to make all animations wit$$anonymous$$n my modelling program (3ds max), including the aim down sights animation.

Is there a technique or a way for me to make an aim down sights animation that will look right w$$anonymous$$le seeing it through the fps controller's camera?

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 Paparakas · Sep 09, 2013 at 11:34 PM 0
Share

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HacksPro · Jul 12, 2014 at 10:36 AM

If you want your camera to aim down the sights when you press the right mouse button follow these steps.

            add your gun into the scene and make sure it looks good attached to the first person controller. Next add the gun into your fps camera. Next add t$$anonymous$$s script into your gun :var Aim : boolean = false; var Cam : GameObject;


function Update () { if(Input.GetMouseButtonDown(1)){ Aim = true; if(Aim == true){ Cam.active = true; } }

if(Input.GetMouseButtonUp(1)){ Aim = true; if(Aim){ Cam.active = false; } } }

Next create a new camera and align it with the sights of your gun and make sure the camra is also added to the gun.

Next click on the gun and you should see the script the right of you screen, then add your newly created camera into the script where it says game object, and your done ! :D

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 HacksPro · Jul 12, 2014 at 10:35 AM

Here is a tutorial if my earlier comment wasn't that clear https://www.youtube.com/watch?v=osdLqFpVkec i take no credit for any of t$$anonymous$$s .

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

16 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 avatar image

Related Questions

Blending between frames in the same animation (fake stop motion) 2 Answers

Mecanim Tutorial lacking animation? 1 Answer

In place animations using Mecanim and how to script it 2 Answers

Mecanim not updating script when it switches state? 2 Answers

Attack Animation through Javascript 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