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 ricardo.ch · Jul 31, 2012 at 10:49 PM · collisioncolliderstaticmeshcollider

Manual Collision Mesh fails on Static Geometry

I have a script that creates a MeshCollider from the mesh I have, by removing any triangles which have an normal angle with World Up larger than a threshold.

So far, this is working correctly, the problem comes in when I set my pieces of geometry to be static. After I do that, the generated MeshCollider is displaced by a certain amount, and my character, predictably, doesn't collide with the platform.

Is there something I should calculate differently when dealing with static objects? There seems to be an offset that is being used for my geometry, which I have not set up.

Any help will be appreciated, thanks!

Red debug draw represents the generated MeshCollider

The geometry has the static flag on. The geometry has the static flag on.

The geometry has the static flag off The geometry has the static flag off.

screen shot 2012-07-31 at 2.31.06 pm.png (35.1 kB)
screen shot 2012-07-31 at 2.30.40 pm.png (27.3 kB)
Comment
Add comment · Show 5
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 ScroodgeM · Aug 02, 2012 at 09:06 PM 0
Share

can you post script that you use?

avatar image ricardo.ch · Aug 02, 2012 at 09:12 PM 0
Share

It's pretty much the same script mentioned here:

http://answers.unity3d.com/questions/236313/one-way-collider.html

I just added some debug drawing.

avatar image ScroodgeM · Aug 03, 2012 at 06:31 AM 0
Share

i did the following: - imported a model in unity - assigned a mesh collider to ir - attached a script from your link - marked object as static - tried to move and rotate object

collider does not displaced from rendering mesh

how can i reproduce the problem?

avatar image ricardo.ch · Aug 03, 2012 at 05:02 PM 0
Share

Create duplicates of the model with the script and collider and move them, then set them as static and run the game. Pause the game and click on the models to see where the collisions lie.

avatar image ScroodgeM · Aug 04, 2012 at 09:54 AM 0
Share
  • created a script that duplicates model from scene, model has mesh collider, after duplicating it was moved.

  • then models was marked as static

  • it's script from link above on models.

  • game was started and paused

  • colliders are at correct position.

can you pack a simple scene with this problem to unitypackage?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ThermalFusion · Aug 03, 2012 at 11:45 PM

There's probably an issue with the actual meshes being changed when turned into static. Perhaps you can make them static after you have generated the colliders. http://docs.unity3d.com/Documentation/ScriptReference/StaticBatchingUtility.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 ricardo.ch · Aug 04, 2012 at 12:07 AM 0
Share

What I'm guessing is that, when turning them geometry static, the instances store an offset from the one taken as the original instance. That offset must be wrong.

I'll try to use Combine after all of them have their collision geometry generated.

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Collider not working with dynamic mesh 0 Answers

How do I detect a collision between two colliders? 2 Answers

Multiple colliders on one object? Or changing variables on a specific clone. 1 Answer

Correct position of overlapping meshes 0 Answers

Is there ANY possible way to use a mesh collider(without convex) with a rigidbody? 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