Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Oct 04, 2015 at 09:03 PM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Darqk · Oct 04, 2015 at 06:01 AM · animationanimatortransitioncrossfade

How can I smoothly transition my player camera from manual control into an animation?

I'm trying to create an inventory system in which the player takes off their backpack and looks into it. I have the basic animation set up, but I am having trouble smoothly transitioning from the player being able to look around freely to the camera being forced to look into the backpack. When I update the camera's rotation in the Update function, even when the animation is not playing, the camera is clamped in the starting rotation for the animation and the player cannot look around. If I change it so that the camera updates in the LateUpdate function, then I can rotate the camera but when I start playing the animation, the camera instantly snaps to the starting position. I would like to achieve an effect where the player would be able to look around but as soon as they press the inventory button, the camera cross-fades from its current rotation into the animation. Sorry if what I am saying isn't clear and thanks for any help.

P.S. I know how I could do this through scripting by just rotating the camera to the starting position and then playing the animation, but I want to achieve a more fluid and dynamic effect and not increase the total time it takes to access the backpack.

P.S.S. I already have code in place that stops the player from walking and looking around when they press the inventory button.

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

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by instruct9r · Oct 04, 2015 at 11:05 AM

I woud parent one GameObject to the player, position it, to the same place, where the camera is and animate it to make the transition from that position to the backpack...

Then when you press the inventory button i woud Lerp the camera from the current position to the position of that GameObject and at the same time, start the animation of the, GameObject to transition.

Same when you get out of the inventory. Keep the camera follow the GameObject, while going back and when it reaches the old position i woud turn off the Lerp.

This way you can have camera to be moved with script (When following the player) and to move with actual animated object, when going to the backpack.

You can turn the Lerp On\Off with one boolean...

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 Darqk · Oct 04, 2015 at 08:50 PM 0
Share

Thanks! :D

Follow this Question

Answers Answers and Comments

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

2D animations transitioning too quickly and looping before finishing 2 Answers

Smooth transition of position between animations 0 Answers

why is my animator transition not working when condition is true 1 Answer

Animation transition preview not showing any curves 1 Answer

How to prevent colliders animating between animation states? Also prevent rotation on x axis of blend tree. 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