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
3
Question by scarpelius · May 04, 2015 at 05:59 PM · camerazoomthird person controller

Camera zoom for Free Look Camera Rig

I would like to add mouse zoom capability to Free Look Camera Rig and Third Person Controller from Standard Asset, but I am unable to understand how they set up the camera distance from character. The best I can do is to move the Pivot but with erratic results.

Anyone know what variable is responsible for camera distance from character and/or how to do zoom?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by smacbride · May 04, 2015 at 08:52 PM

I use the scroll wheel and change the camera's field of view. Works great.

Use the Mathf.MoveTowards function listed here: http://docs.unity3d.com/ScriptReference/Mathf.MoveTowards.html

Comment
Add comment · Show 1 · 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 kalishuck · Nov 03, 2016 at 08:39 PM 0
Share

could you provide more details? At least, how to you assign camera's position Z value?

avatar image
0

Answer by kalishuck · Nov 03, 2016 at 09:13 PM

Have the same problem. What I found, is that you can use Camera's fieldOfView property for zooming. See http://answers.unity3d.com/questions/218347/how-do-i-make-the-camera-zoom-in-and-out-with-the.html

So, for Free Look Camera Rig, the script will look something like this:

     var scroll = CrossPlatformInputManager.GetAxis("Mouse ScrollWheel");
     if (scroll != 0) {
          var cam = m_Cam.gameObject.GetComponent<Camera>();
          var fov = cam.fieldOfView;
          fov += scroll * 10f; // 10f - intensivity
          cam.fieldOfView = Mathf.Clamp(fov, 25f, 100f); // 25f, 100f - min, max borders
     }

There are also some comments saying that manipulations with FOV could cause nausea and distortions... but who knows...

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

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

Related Questions

Zoom in on object and make other objects disappear on zoom?,Zoom in on object and make other objects disappear 0 Answers

2.5d Side Scroller Dynamic Camera Zoom 1 Answer

Keep Player + Party and/or Targeted Enemies in Camera Focus 1 Answer

Avoid/Minimize Sprites extrapolation in 2D while camera changes size 0 Answers

Third Person Controller and Smooth Follow Camera stop orbit 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