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 hexagonius · Jan 31, 2017 at 12:16 PM · colliderscalefixedupdatephysxpenetration

How to scale a collider still conforming to PhysX?

I wanted to ask if it is even possible to scale a gameObject with collider so it stay's in sync with PhysX. I have a sphere that I want to scale up. It's lying on the floor. I tried scaling the object in both Update and FixedUpdate, but none of both ways made the collider stay on top of the surface. It's just sinking in and eventually getting out again. Running that at a fraction of time I can see that the iteration solver is doing its work, slowly.

Maybe I'm looking at this the wrong way. Maybe I have to move the object away from any collider surrounding it myself, but I wanted to be sure.

(The green sphere is the one scaled up. Notice how it penetrates the floor, even though it's scaled in FixedUpdate). alt text

screen-shot-2017-01-31-at-130842.png (76.7 kB)
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
1
Best Answer

Answer by Loui_Studios · Jan 31, 2017 at 12:37 PM

You could try reducing the fixed time step, but that would increase the physics load.

Might I suggest a simpler solution?

Translate the object on the axis you're scaling -so that the object's collider never actually clips through objects in the first place.

It would have the same effect.

Otherwise, you need to find out the exact time in milliseconds that it takes for PhysX to correct the object, and then use that as your delay between scaling.

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 hexagonius · Jan 31, 2017 at 02:18 PM 0
Share

Thanks for the tips. I was thinking about moving while scaling and from what you're saying it also sounds like the best solution. cranking time steps sounds dumb considering only one gameobject scaling every now and then. Your last suggestion involves waiting during the scale, am I correct? I think that gives a visual stutter and might be slow.
I think I try a combination of final size spherecast and moving.

Thanks anyway :)

avatar image Loui_Studios hexagonius · Jan 31, 2017 at 02:23 PM 0
Share

Yes my last solution would have a short delay in it.

There is one final option that you may consider.

You could scale the sphere with the point that is touching the ground being the pivot. It wouldn't work well if you planned on rotating it, but the pivot point would never move while the object is being scaled, so the bottom of the sphere would always stay at one point, while the rest of the sphere is scaled.

Thanks for accepting my answer. Comment if you need any more help! :)

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

71 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

Related Questions

Mesh Collider from 3d max animation? 1 Answer

Warning: BoxColliders does not support negative scale or size 4 Answers

Boxcollider is much bigger than the actual Object (imported from Blender) 2 Answers

Can I catch "Gu::ConvexMesh::loadConvexHull: convex hull init failed!" error? 2 Answers

Excluding some physics collisions 3 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