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 /
  • Help Room /
avatar image
0
Question by nkj79 · May 16, 2016 at 06:33 PM · unity 52drotationcanvasmobileoptimization

Rotating multiple images continuously (2D) - Mobile performance/optimizations

Hi,

I am experimenting some performance related things on a 2d game for mobile. I am using Unity 5.2 GUI (canvas). I need to rotate 8-10 images simultaneously and continuously on z axis. I tried following code, there was only 1 image on scene and no other code was there. But still the performance was not very good, specially on mobile. On desktop (unity editor) fps was around 80-90 (according to Unity Stats). On android we can see some slight jerks. I don't want these jerks coming up.

 void Update() {
     this.myImage.transform.Rotate(0, 0, 100.0f * Time.deltaTime);
 }

I tried using FixedUpdate but there was no difference. On google when searched I found some references doing rotation using Physics (rigidbody2d and torque) but not able to find any useful example of the torque as I am quiet new to physics.

So could anyone please share some ideas on how to implement continuous rotation in mobile with high performance.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by FortisVenaliter · May 16, 2016 at 06:36 PM

What you have there is the simplest way to rotate an image. If you're seeing hitches, then one of two things are at play:

  1. The GPU on the phone just can't handle dynamic rendering that well, especially if it's an older phone.

  2. (more likely) the hitch is coming from somewhere else. You generally can't assume it's the rotating image, so you need to profile the program and determine the actual source. Usually, with problems like this, it's memory management.

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 nkj79 · May 17, 2016 at 03:34 PM 0
Share

Thanks for your reply. #1 I have a Snapdragon S4 / Adreno 305 android 4.2 mobile, which should be sufficiently good to handle this simple rotation. #2 I have absolutely nothing other than following one line of rotation. I want to know if there is any other way (maybe some low end APIs) to get more performance for rotation. Specially when I will be rotating 8-12 objects at same time.

avatar image
0

Answer by PhantomSarcasm · May 18, 2016 at 02:05 PM

I found a similar problem when I rotate an object in the animator and the solution I found was to change the ownership of euler rotation in the interpolation option "euler angle (quaternion approximation)" ..... I guess you would have to put something like this in the script ....

transform.rotation = Quaternion.Euler (0f, 0f, 30f);

but like I said my problem was similar but the animator ..... try it and if it's advised to be clear .......   forgive my English I do not speak English I'm using google translator .... :) :) :)

obviously is just the script, you would have to attach to your variables

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

i have created a wheel and added the rotation now its rotating in the anticlockwise direction,how can it made to be rotated in the clockwise direction 0 Answers

Flip Rotation of transform when it bounces off a wall 1 Answer

2D Trail Renderer problem !! 0 Answers

can't figure out top down 2D rotation (noob) 0 Answers

Jittery movement of the camera when rotating AND moving - 2D top down 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