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 kbczst · Feb 26, 2014 at 12:30 PM · 2dperformancedirectionflip

how to build a 2d character which can faced 2 directions(left and right), with high performance

I made a character, as a prefab, faced left side.

When I need a character face right side, I made a "scale.x *= -1" on it's transform component, known as "flip".

It looks ok in editor, I placed 6 character in one scene, 3 faced left, 3 faced right, frame rate is about 160(drop down from 200).

but when I run it on my mobile phone(samsung 9082, 2 cpu cores), the frame rate drop down to 15(from 60).

I delete 3 characters faced left(or 3 characters faced right), frame rate become 60. That means if there was only 2 characters which has opposite direction, the frame rate down to 15.

I tried place 20 characters with the same direction in one scene, frame rate is 50(only cost 10 frames). so I can say, the flip caused this problem.

But how to solve it? how do you guys make characters faced two directions?

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

1 Reply

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

Answer by Ashutosh8126 · Feb 26, 2014 at 12:49 PM

I don't think that the actual reason the drop of framerate is character scaling in any terms.. It can be due to the rig structure of the character and also do check your character textures sizes for Mobile Devices// Other way of fliping your character is to use a type a shader for the character which displays both ways.. It depends on the shader you are using.. And them you can simply rotate the character on the Y Axis

Comment
Add comment · Show 3 · 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 kbczst · Feb 26, 2014 at 03:42 PM 0
Share

"rotate the character on the Y Axis" solve this problem perfectly.

framerate in battle scene is also 60 now.

thanks a lot...Ashutosh8126. But this is also proved that the reason of the drop of framerate is character scaling, isn't it?

avatar image Ashutosh8126 · Feb 26, 2014 at 05:59 PM 0
Share

NO character scaling is never a problem.. I think you should check the texture compression settings.. click on the texture of the character and check its compression settings on the inspector.. If you found solution in my above answer then please click on the answered button on the left.. :) thanks..

avatar image kbczst · Feb 27, 2014 at 02:04 PM 0
Share

filter mode: bilinear format: compressed max size: 1024

is it ok?

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

21 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

Related Questions

Flip 2D player in x-axis to face movement direction 5 Answers

Choppy Character Movement Unity 2D 0 Answers

How to improve device heating (Android) 1 Answer

Enemy moving left towards player. 1 Answer

Localscale-flipped 2D character retains original rotation since 5.4 2 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