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 manhuntz111 · Aug 26, 2016 at 01:26 PM · lerprecttransformlaggy

Help with recttransform lerp , lags on mobile not on pc.

Why is this code lagging on my mobile ( android ) ,whenever it runs and not on my pc? . Please help anyone!!

@DiegoSLTS

public void AboutBtn() { StartCoroutine(about()); }

  IEnumerator about()
  {
      float elapsedTime = 0f;
      float lerpDuration = 1f;
      menuBool = true;
      menuBarAnim.Play("menuBarAnimationB");
      sidebarAnim.Play("SideBarAnimB");
      Vector2 Origin = MoverR.anchoredPosition;
      Vector2 Destix = new Vector2(Origin.x, -3658); //replace 6050 with the position you want
      while (elapsedTime < lerpDuration)
      {
          elapsedTime += Time.deltaTime;
          MoverR.anchoredPosition = Vector2.Lerp(Origin, Destix, elapsedTime);
          yield return null;
      }
      anim = false;
      menuBool = false;
  }
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 DiegoSLTS · Aug 26, 2016 at 01:33 PM 1
Share

That code alone shouldn't be a problem in mobile, maybe you have low framerate all the time but you only noticed when doing an animation.

You should profile your game. You can build and run into your device directly from Unity and then use the profiler to get runtime stats of your game. You can trigger the lerp and see what's the CPU doing during the lerp.

avatar image manhuntz111 DiegoSLTS · Aug 26, 2016 at 01:43 PM 0
Share

Got 2 devices - Samsung galaxy tab s 8.4 and Xperia $$anonymous$$

Lag is a little on tab and really bad on xperia m , I only have lag when the lerp starts in mobile and not on pc. I will check the profiler right now.

avatar image manhuntz111 DiegoSLTS · Aug 26, 2016 at 01:46 PM 0
Share

alt text

thingyyy.png (227.8 kB)
avatar image DiegoSLTS manhuntz111 · Aug 26, 2016 at 01:51 PM 1
Share

Click over some of the blue areas in the CPU line, and you'll see what methods are causing that in the bottom half of the window.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by manhuntz111 · Aug 26, 2016 at 02:08 PM

Nevermind , solved it . The problem was the canvas had pixelperfect (true) , making it false doubled the performance no lag now. :)

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

67 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Need help debugging speed difference in different UI elements 0 Answers

Tilting a camera around an object 0 Answers

Acces shader color and lerp 1 Answer

If statement not getting called after Lerping a Scale 1 Answer

Lerp to Gaze Location Smoothing Motion Issues (Cardboard) 0 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