• 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 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
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 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
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 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
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 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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

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

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

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

How to make an FPS Camera, Wii game style? 0 Answers

Storing camera angles for a FPS -1 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges