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 frostyFroggs · Dec 17, 2015 at 04:03 PM · gameobjectcomponentactivation

Problem optimization SetActive and Cloth

Hi everyone, I work on a mobile project where i use the component "Cloth" of unity to create a Jelly effect on a cube . But here is the problem : when i activate the Gameobject that contain that component with "SetActive(true)" i get a huge lag

However in play mode, if i activate the gameobject via the editor, there is no lag .

alt text alt text

So , here is what i need: i need to activate/desactivate those object because i use a "pool". And also , desactivate the component "cloth" doesn't stop the physics of this component.

Thanks guys

image2.jpg (277.2 kB)
image1.jpg (274.7 kB)
Comment
Add comment · Show 3
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 TonicMind · Dec 17, 2015 at 04:26 PM 0
Share

Are you calling Setactive(true); many times or just once? Remember this depends on whether its in a loop or a function which gets called many times (such as Update() ).

avatar image frostyFroggs TonicMind · Dec 17, 2015 at 04:34 PM 0
Share

I call just once and that causes the lag.

avatar image TonicMind · Dec 17, 2015 at 04:42 PM 0
Share

Is your Setactive within a LateUpdate() or attached to an object being moved non-physically? By that I mean are you moving or rotating it by moving the transform directly?

If it is not within LateUpdate() then try placing it there.

EDIT: I just read something about interactive cloth. Its very inefficient regardless and the Unity dev $$anonymous$$m is phasing that one out in future versions. Fortunately there's an alternative: skinned cloth. Try that one!

This is what I read: http://blogs.unity3d.com/2014/07/08/high-performance-physics-in-unity-5/

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by sartubakia · Jan 03, 2018 at 08:47 PM

Same prolem, when i hide cloth parts on character. I use different skins, cloth does not work after enable gameobject on cloth component.

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 sartubakia · Jan 03, 2018 at 08:48 PM 0
Share

Only solution is disbale and then enable cloth component, but for me its crash Unity

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

38 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

Related Questions

NullPointException Object not found, caused by a variable not accepting value? 0 Answers

How to remove added component from prefab after game is stopped ? 1 Answer

Why can't you add editor scripts to GameObjects even if the tag is EditorOnly? 0 Answers

Adding created component to game object. 0 Answers

Is there a way to refer to the only script the object has without naming the script? 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