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 thatfoolsean · May 06, 2015 at 09:19 AM · androidiosmobileoptimizationscrolling

How to Smooth X Axis Movement on Mobile Devices?

Hi,

I am working on an endless runner game for iOS and Android, and I am trying to simply scroll my background by at a consistent speed on the X Axis. I am currently using the below code for the background scrolling, and while the scrolling works, it is a little "jerky" and "stuttering" on iOS, and even more so on Android (I am testing using an iPhone 6, iPad Mini Retina, and Samsung Galaxy 4 Tab).

     //This should stop Unity from trying to grab the Transform component of my gameobject each frame!
     // I have dragged this gameobject into this variable in the inspector!

     public Transform        me;

     void Update ()
     {
         //Make sure that scroll speed equals MissionControl's speed!
         scrollSpeed = MCscript.speed;
 
         //Move to the left, consistently!
         me.Translate (Vector3.left * Time.smoothDeltaTime * scrollSpeed);
      }

I've looked online and found a variety of different options to try and fix this problem, and none of them have worked for me, but it seems like almost all of them involve V Sync settings which I don't think I have control of on mobile. Can anyone help? Thanks in advance for your help, and let me know if you need anything else from me at all!

(Using Unity 5 Personal License on a MacBook Pro Retina 13inch Early 2015 model)

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 thatfoolsean · May 05, 2015 at 09:13 PM 0
Share

Hi Tanoshimi,

$$anonymous$$y camera doesn't move.

Sean

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Halfbiscuit · May 06, 2015 at 11:50 AM

Update can be a bit varied in when it is called, for physics changes like this you can try using:

FixedUpdate()

Under 'Project Settings -> Physics' you can change how often this function updates if you want a smoother change.

If this does not solve the issue and your frame rate is low on the mobile device then this issue will be hard to prevent. You may need to look into optimizing your game in that case.

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 SniperED007 · Jan 13, 2016 at 07:12 PM

you need to tell Unity to try use 60 FPS for iOS:

 void Start()
 {
   Application.targetFrameRate = 60;
 }

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Having just one scene in the game: is it inefficient? 2 Answers

Is Gyroscope supported on all mobile Android iOS devices with a gyroscope? 3 Answers

Receiving UI/touch events while mobile soft keyboard is open 0 Answers

Can a iOS game camera have the Bloom optimized effect with clear flags = depth only? 0 Answers

Is it okay to store many player preferences for mobile? 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