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 /
avatar image
0
Question by naf456 · Jun 25, 2011 at 10:07 PM · camerafollowspacessao

Weird Camera Follow Problem

I have this weird camera follow problem, where as, my camera target slowly creep forwards till my spaceship is flying behind it. i don't know why- I've been itching my head all day. there is no silly rigidbody placements or alike I'll quadrupedly checked every property on my scripts, yet it still occurs. Here the proof : http://www.youtube.com/watch?v=jaUaZZ1buYA

here's my follow camera script:

 var target : Transform;
 var distance = 3.0;
 var height = 3.0;
 var damping = 5.0;
 var smoothRotation = true;
 var rotationDamping = 10.0;

 function LateUpdate() {

     var wantedPosition = target.TransformPoint(0, height, -distance);
         transform.position = Vector3.Lerp (transform.position, wantedPosition,
         Time.deltaTime * damping);

 if (smoothRotation) {
         var wantedRotation = Quaternion.LookRotation(target.position -   
         transform.position, target.up);
         transform.rotation = Quaternion.Slerp (transform.rotation, wantedRotation,  
         Time.deltaTime * rotationDamping);
 }

 else    transform.LookAt (target, target.up);
 }

   


by the way, it'll also be nice kill two bird with one stone and to have an answers why the SSAO seems to draw lines on my ship aswell. Thanks for any replies!

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

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Heratitan · Jun 25, 2011 at 10:38 PM

I'm not 100% sure about this but, what it looks like is that your ship is moving fast enough that at the rate your camera is following, it can not keep up. In other words: The damping is too high.

Try decreasing your damping and see if that works.

I hope this helps.

Comment
Add comment · Show 7 · 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 aldonaletto · Jun 25, 2011 at 11:03 PM 1
Share

Yes, it looks like a typical feedback problem: at each update the differences between real and wanted position/rotation are calculated and used to correct the camera (it's done by the lerp and slerp functions). At some combination of correction "gain" and speed, the system starts to oscillate. You must slow down the camera movement to avoid this oscillation - reduce the damping and/or rotationDamping values (reducing them actually increase the system damping).

avatar image naf456 · Jun 27, 2011 at 09:10 AM 0
Share

It's kinda solved that, but now I get this Ghosting effect were as my spaceship looks like it's violently shaking all the time. Problem after problem ey? Also, I've seen other youtube video's with space ship in- they have ton's of damping?(a little too much I$$anonymous$$O) I may have to increase the damping if the quternion of the space ship changes violently, this may let me add more(less) damping.

avatar image runonthespot · Jun 27, 2011 at 10:01 AM 1
Share

Re: Shaking/Ghosting, fiddle with rigidbody settings, particularly interpolation/extrapolation?

avatar image naf456 · Jun 27, 2011 at 10:53 AM 0
Share

No-it wasn't the rigidbody, because when the camera was attached to the ship as a child, the shaking do not occur. I finally fixed that problem from taking the camera function off of LateUpdate to FixedUpdate. this may cause problems with low framerate as the camera may return out of sync again. Also now I have that weird alignment problem I had before. No matter how High I set the Dampen value, it Never stays aligned (-nor how slow I turn). This is REALLY starting to anoy me. I thought the Camera was the easiest thing to setup!

avatar image runonthespot · Jun 30, 2011 at 03:18 PM 1
Share

Excellent- thanks for updating us.

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Camera Shaking At High Speed 1 Answer

Rotate spaceship based on mouse movement 2 Answers

Super Monkey Ball type Camera? 2 Answers

Camera setup question 2 Answers

In-world "screen" from camera? 1 Answer


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