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 jg2115 · Feb 02, 2014 at 03:40 PM · cameratransformpositionjumpingjerky

Smoother Camera Movement without making camera child of the player?

I am making a 2d endless runner. I have the camera always moving at the speed the character is supposed to be moving. However i want the camera to follow the character's y movement. when I make them equal eachother: transform.position.y=target.position.y

I get jerky camera movement when jumping. When i make the camera a child of the player it is perfectly smooth. Any ideas? I can post more script if needed.

Comment
Add comment · Show 3
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 VTW · Feb 02, 2014 at 03:49 PM 0
Share

What if you match the camera's y velocity to the player's y velocity? Then ins$$anonymous$$d of manually setting to the player's position each update, it will simply move upward (or downward) at the same speed as the player.

It would require some fine-tuning when the player lands on whatever surface he's on. Perhaps once grounded you could call your position code mentioned above?

avatar image Owen-Reynolds · Feb 02, 2014 at 04:30 PM 1
Share

Jerkiness can sometimes be an out-of-order problem. Like player moves in Update and camera in FixedUpdate. Or camera moves, then the player does (making the camera always slightly off by a random amount.)

Also, most people prefer a fast (anything 0.2 or more) Lerp ins$$anonymous$$d of =. That way, when you jump, you go a little but up on the screen before the camera tracks you. Feels more like you're moving.

avatar image jg2115 · Feb 02, 2014 at 05:18 PM 0
Share

Thanks the lerp worked great:D

0 Replies

· Add your reply
  • Sort: 

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

19 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

Related Questions

How do you move the camera relative to the direction it is currently facing? 1 Answer

Finding the limits of transform coordinates 1 Answer

Lock Camera to be within a box type area? 1 Answer

Changeing Camera Position 1 Answer

How To Slow Camera Position Transform? 3 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