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 franek3325 · Feb 13, 2014 at 09:04 PM · android2dsmoothjerking

Unity 2D game - objects jerking (only android)

Hi all,

I have a very annoying problem associated with jerking objects - but only on android device. I have simple script, that change position of object (simple texture sprite). On PC it is working well, but on android, in irregular time interval, the object is jerking. I tried a lot of issues, like: FixedUpdate(), LateUpdate(), deltaTime, change Fixed TimeStep, but no one helped me. I try also Vector3.Lerp() but it still don`t work. The script looks like:

 void FixedUpdate () {
     //transform.position += new Vector3(1, 0, 0) * 2.5f * Time.deltaTime;
     target = transform.position + new Vector3(5f * 2.5f * Time.deltaTime, 0, 0);
     transform.position = Vector3.Lerp(transform.position, target, 1);
 }

Have you any suggestions to resolve that issue? I will be grateful for every help. Sory for my poor English ;)

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 POLYGAMe · Feb 13, 2014 at 09:24 PM 0
Share

How much other stuff do you have going on in the scene? $$anonymous$$aybe it's too much for the device? Also, the target is moving... is that what you want to do? I'm guessing lerp could be struggling because the target is being updated every frame. And why 5 * 2.5? Why not just the whole number?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by POLYGAMe · Feb 13, 2014 at 09:28 PM

Basically in that code, all you're doing is moving the sprite continuously on the x axis as the target is offset from the sprite's own position and is constantly moving. If that's the behaviour you want, just use transform.Translate(speed, 0, 0).

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 franek3325 · Feb 13, 2014 at 10:18 PM 0
Share

Thanks for the reply. I don`t think that this is performance problem. I placed a lot of objects (also try one object, as in this example) on the scene and the problem still occurs. Numbers like 5f * 2.5f, was random numbers, only for test. I move the sprite only on the x axis, because I tested whether complicated operations, or not - in that case, have influence on this issue.

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

Expand object on touch? 1 Answer

buttons not working in android. 1 Answer

TouchCount always > 0 on Android 1 Answer

How to control a 2d character in an top-down android game with the standard joystick? 1 Answer

Trouble with Screen Glitch with Android Build 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