• 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
Question by navparker · Dec 22, 2010 at 06:59 PM · camerafpsthird-persontransitionfirst-person

Transition between 1st person and 3rd person cameras

Any tips on how to transition between 1st Person camera and 3rd Person camera? An example would be the Metroid Prime games and Perfect Dark 64. Camera moves from inside the player's head to behind the player and vice-versa.

Comment

People who like this

0 Show 0
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

Answer by Mickydtron · Dec 22, 2010 at 07:10 PM

You could have two cameras, one first person and one third person, and change the depth values to change which one the player sees. As far as making it smooth, if you are using a smooth follow script on your third person camera, then you could script its distance down to a small number and then swap depths, and when you want to swap back, swap depths back and then script the distance back to what you want it to be.

Comment

People who like this

0 Show 0 · 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

Answer by Jason_DB · Dec 22, 2010 at 07:55 PM

You could set two positions: a 3rd person position and a first person position. When you want to transition between the two, move the camera to the desired point over a second or two.

Here's an example of something you could put in update to transition to first person (FpsPosition is the Vector3 position of the camera in FPS view, transitionRate is how long the transition would take, FPSview is a boolean which is true when you want to be in FPS mode) ;

        var curVect : Vector3= FpsPosition-transform.localPosition;
        if (transform.localPosition!=FpsPosition && FPSView){
            if(Mathf.Abs(Vector3.Distance(transform.localPosition , FpsPosition)) < curVect.magnitude/transitionRate*Time.deltaTime){
                transform.localPosition=FpsPosition;
            } else {
                transform.localPosition += curVect/transitionRate*Time.deltaTime;
            }
        }

To do it for third person would be more or less the same, just put check that FPSView is false, and transform toward the Third person camera position.

Comment

People who like this

0 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 navparker · Dec 27, 2010 at 09:09 PM 0
Share

Thanks for your help!

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

No one has followed this question yet.

Related Questions

How do i combine first and third person views? 1 Answer

First Person Camera switch to Third Person Camera on Object 2 Answers

How to make two cameras face the same direction? 1 Answer

Locomotion System Error When No Shadows "Line-sphere intersection failed" 1 Answer

Cinemachine Problem 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