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 eddyzy · Feb 19, 2014 at 08:38 PM · movementperformanceguitexturertsquad

What`s more expensive GUI Texures or Quads for displaying units health?(RTS)

Hello,

So what should i use? Quads that follow the units and change color? OR GUI texures that aquire the units position by ray shooting?

And what should i use for smooth movement, FixedUpdate?

Thx in advance.

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
2

Answer by robertbu · Feb 20, 2014 at 12:25 AM

Whether you should worry about this issue depends on the number of units you have and what platform you are authoring for. GUITextures cost a drawcall each. It is possible to get all of your Quads to batch together into a single drawcall, but to do so is not as simple as just setting the Material.color. To cause your Quads to batch, you must use a Texture Atlas and/or use Vertex colors to change the color of your Quads. Setting the Material.color attribute breaks batching, so a Quad would be no more efficient than a GUITexture.

Most positioning of a GUITexure does not require a Raycast. It can be done by Camera.WorldToViewportPoint(). As for smooth movement, Update() or possibility LateUpdate() is likely the best choice.

Comment
Add comment · Show 5 · 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 eddyzy · Feb 20, 2014 at 01:10 AM 0
Share

You`re right GUI textures are better.

(I just spent 3 hours on quads and they just move miserably)

I used Gui Textures + Camera.WorldToViewportPoint() before, but there`s a slight delay when I move the camera,and I thought that quads may perform better, but I was wrong ...

avatar image robertbu · Feb 20, 2014 at 01:20 AM 1
Share

Are you doing your movement of Quads and/or GUITexture in LateUpdate()? That may solve any lag issue.

avatar image whydoidoit · Feb 20, 2014 at 01:38 AM 1
Share

@eddyzy definitely don't use FixedUpdate for anything to do with the screen, that can cause jerkiness as the physics step does not necessarily update every frame. Quads can be totally smooth - so something interesting is going on with the order of things that you do.

avatar image eddyzy · Feb 20, 2014 at 12:09 PM 0
Share

Well quads are nice,but following the unit is the problem. I can`t seem to find a way to make the quads follow the unit smoothly. A idea on how to do that?(I used update and the movement isn`t that smooth as GUI Texures)

avatar image robertbu · Feb 20, 2014 at 03:10 PM 0
Share

Use LateUpdate(). That may not be the whole 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

Simple RTS movement offset 0 Answers

gameobject move in real = move in GUI 1 Answer

Moving selected unit to location in space rts based on screen touch 3 Answers

Keeping A Character On The Terrain (Allow no Y movement) 2 Answers

Fixing Issues with custom RTS Camera Controll Script 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