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 noambe · Sep 28, 2014 at 10:09 PM · cameraupdatespeedslowlaggy

Laggy camera on const moving speed

Hello,

I'm building a 2D game with a camera moving at a const speed over a bunch of sprites (2048x1024). The camera moves pretty laggy though, and the result is that the sprites seem to be "jumping" when the camera scrolls over them. The lagginess occurs both on PC and Android device.

I must be doing something wrong because this scenario is too basic...

I use this to update the camera position:

 void Update () {
     transform.position = new Vector3 (transform.position.x + 5 * Time.deltaTime, 0, -10);
 }

I'm also attaching a screenshot of my camera settings, for what it worth.

Anyone can help me with this?

alt text

Thanks! Noam

capture.png (37.9 kB)
Comment
Add comment · Show 7
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 robertbu · Sep 28, 2014 at 10:11 PM 0
Share

How many sprites do you have? I assume the 1024 x 2048 is the size of the texture used on the sprites? What does the Stats say (click on 'Stats' in the upper right of the game window)?

avatar image noambe · Sep 29, 2014 at 05:42 AM 0
Share

For simplicity I reduced it for just 1 sprite. Its resolution is 4096x1024 but in Unity its defined with max size of 2048 (because not all Android devices can render 4096). Sorry if I'm using bad terms - but I guess yes - this it is the texture size used on my sprite.

I'm attaching info from my PC stats and other relevant info, not sure how to see the stats on my Android device - but the behavior is worse there.

alt text

capture.png (12.4 kB)
capture2.png (64.3 kB)
avatar image robertbu · Sep 29, 2014 at 05:44 AM 0
Share

Does the issue still occur with just one texture? According to the Stat data, you are running at 60+ fps.

avatar image noambe · Sep 30, 2014 at 04:42 PM 0
Share

Bumping thread...

I just need an answer to a simple question: how to make a camera move smoothly over a sprite? Are there special requirements from the sprite/camera that needs to be met in order to have smooth movement?

I mean - its as simple as opening an image on Windows and scrolling left and right - why is unity having such trouble doing so?

Thanks, Noam

avatar image Eno-Khaon · Sep 30, 2014 at 05:01 PM 0
Share

You should try the same test with smaller image resolutions and varieties in shader properties attached to your objects. For example, a very large image with a large amount of transparency might not perform well on extremely weak video processing hardware. This form of "video lag" would appear to result in stuttering movement.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Wiki

Answer by Madeck · Sep 29, 2014 at 08:16 AM

What happens if instead you use the following function to update the camera position:

 transform.position = new Vector3 (5 * Time.time, 0, -10);

Although it is probably a minimal change, I feel like using deltaTime for your camera position can induce errors in the long run.

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 noambe · Sep 29, 2014 at 06:42 PM 0
Share

Tried - no difference. The problem starts right on the beginning, so long run is not a factor here.

I'm trying to understand whether this is a coding problem or a weak device problem...for example when running the same code in Windows Phone I don't see such laggyness... But on the other hand I have only 1 sprite...is that so difficult to render?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Slow camera move speed? 2 Answers

Camera rotation on mouse drag? 2 Answers

even just cubes moving seems choppy 1 Answer

Mac Team Server Updates are slow 2 Answers

Child object slows my character speed 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