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
0
Question by DvdRB · Oct 13, 2010 at 03:19 PM · cameraviewanimatepresets

Camera location to camera location animation

I am needing a bit of help with a script that will allow an animation from view point to view point with a camera, or series of cameras. For an example see:

http://www.buchhofer.com/upload/files/labs/drexel/

Brilliant architectural viz work by Dave Buchhofer!!

Thanks!

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 DvdRB · Oct 15, 2010 at 01:47 PM 0
Share

Apologies about the ambiguity - the reality is that i am really looking for "best practice/method" as much as "best solution." The reason for the link is to hopefully explain the intent. Looking into your answer this weekend, and will post back if i have any q's. Thank you for the response!!

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by skovacs1 · Oct 13, 2010 at 05:18 PM

You should be more specific about what exactly you need help with. I have no idea what exactly you are asking for.

From what I saw, all that they did was use Lerp and LookAt.

var lookAtTarget : Transform; //What to look at var current : Transform; //Where to start var transitionTime : float = 1.0f; //Time to take to transition

function Start() { //Initial positioning if(current) transform.position = current.position; //position if(lookAtTarget) transform.LookAt(lookAtTarget); //look at target }

//Call this with the transform to move to. static function MoveCamera(target : Transform) { if(!target || current == target) return; //Nowhere to go if(!current) { //Nowhere to start from, so initial positioning transform.position = target.position; //position if(lookAtTarget) transform.LookAt(lookAtTarget); //look at target } else { var control : float = 0; //Amount along transition while(control < 1.0) { //Continue until we reach the destination control += Time.deltaTime/transitionTime; //move along transition transform.position = Vector3.Lerp(current.position, target.position, Mathf.SmoothStep(0.0, 1.0, control)); //Smoothing optional if(lookAtTarget) transform.LookAt(lookAtTarget); //look at target yield; //wait } } current = target; //we're now at the target's position; }

If you want to instantly switch camera position and orientation to some other position/orientation, you could use transform.position = target.position; transform.rotation = target.rotation; If you want to actually switch to a different camera, you could enable/disable cameras with camera.enabled = false; target.camera.enabled = true; or something like that.

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 Bill Blakesley · Mar 01, 2011 at 10:05 PM

I keep getting compile errors with this script. This is javascript correct?

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

No one has followed this question yet.

Related Questions

Unity camera troubles 1 Answer

first and thirt person view 1 Answer

Multiple Monitor Cave Setup with three Cameras 2 Answers

How do I render to texture only a part of the cameras view? 0 Answers

Camera looking at players face 2 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