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 /
avatar image
0
Question by QuilloGames · Jan 10, 2020 at 07:15 AM · game objectstatic batchinggame objects

Should game objects with unchanged transform position but playing 2D sprite animation be "static"?,About setting non-moving game objects to static, does 2D sprite animation count as moving?

Hi, I read that setting non-moving game objects "static" can optimize performance. But I am not sure about if the following cases are counted as "static":

  1. Objects with unchanged transform position, but with 2D sprite animation played by an animator controller.

  2. Objects with unchanged transform position, but will be switched between active and inactive during game play.

  3. Objects with unchanged transform position, but certain components will be enabled and disabled during game play.

  4. Objects with unchanged transform position, but will be removed during game play.

Thanks for any help

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
1
Best Answer

Answer by ashishcw · Jan 10, 2020 at 09:39 AM

As far as my opinion, the static functions can be set to the objects, which as available in the game/scene, however they do not mean to move/change their transforms, meaning, these objects are precomputed in the engine, which adds huge performance boost.

In your case, as you pointed it out correctly, since you won't be moving the objects anywhere, it's a good idea to set them to static.

For example, in one of my projects, I had trees as an objects which needed to animate(Sort of a wind effect), setting all of them to static(also known as static batching, and performing animator on it, did the job, without compromising much on the performance. https://answers.unity.com/questions/593206/how-static-batching-works.html

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 QuilloGames · Jan 15, 2020 at 08:44 PM 0
Share

Thank you!

avatar image
1

Answer by RemDust · Jan 16, 2020 at 02:24 PM

In this context, "moving" has nothing to do with "animating".

Static, dynamic and sleeping are physics (rigidbody) related, which sprite is actually displayed has nothing to do with your rigidbody state. :)

Comment
Add comment · Show 2 · 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 QuilloGames · Jan 16, 2020 at 03:22 PM 0
Share

Thank you for the explanation. Does that mean if there is no rigidbody component in the object, it doesn't matter if it is set to static?

avatar image RemDust QuilloGames · Jan 16, 2020 at 04:03 PM 0
Share

static is actually a Rigidbody property ! You can't set it if you don't have the rigidbody component on your gameobject ;)

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

119 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 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

Saving an object from script to project? 0 Answers

Log game object's actions 0 Answers

if game object is located at... 1 Answer

Help with GameObject.FindGameObjectsWithTag 1 Answer

Sprite Not Showing after build to .apk Unity 5.4 ?? 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