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 Mystic 2628 · Apr 11, 2014 at 06:33 PM · import

Adding collision to models imported from Sketchup

I've been using Sketchup recently to make all my models for games as Blender is too complicated and I still haven't even installed or learned how to use Maya yet. I've been trying to import a model from Sketchup but it has no collision once in the editor. The model is an open topped ring with a risen circular platform in the center of the floor.

I've used all solutions that i've been told and none have been able to add proper collision. I've tried turning "Generate Collisions" on in the import settings. I've tried using the sketchyphysics plugin for Sketchup, i've tried exporting as .fbx (which is actually better than .dae), i've even tried to turn every section of the model into a different group so each section has its own mesh and still the bullets i'm trying to fire at it won't collide with it.

So far, after a long time of playing with it, i've managed to make some bullets reflect off the wall after colliding with certain places, although i have them set to destroy themselves once they hit a wall, which is quite wierd. The bullets themselves do have collision, as i have a block on the scene that actually moves once a bullet hits it, but the bullets clip right through the arena wall and i have no clue about where they coliide and where they don't. Basically, the walls of the ring have a small red indent running the whole way around so i can add some red lights in there, but the bullets seem to hit the red indent, bounce off, then hit the actual wall, bounce off that, but then clip right through the red indent when they hit it again...

It's like it collides when it wants to. Also, i've been getting a ton of errors saying "Compute mass inertia tensor failed for one of the actor's mesh shapes. Please change mesh geometry or supply a tensor manually", which i don't understand at all.

Comment
Add comment · Show 4
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 ivomarel · Apr 11, 2014 at 07:16 PM 0
Share

For the error: http://answers.unity3d.com/questions/14497/actorupdatemassfromshape-error.html

Does the model have mesh colliders? Could it be in your bullets code ins$$anonymous$$d of that there's something wrong with the imported models?

avatar image Mystic 2628 · Apr 13, 2014 at 01:20 PM 0
Share

Well i'll try a bit of debugging then.

avatar image Mystic 2628 · Apr 14, 2014 at 04:14 PM 0
Share

Should I just try using a different program? It worked pretty well when i used Blender, although it was a bitch and a half to find out how that damn interface works.

avatar image Mystic 2628 · Apr 14, 2014 at 04:32 PM 0
Share

Ok. For some reason, the bullets are rotating and spinning out of control once they go through the wall, but the debug message for colliding with the wall isn't displaying. The wall has box colliders, the bullet has a capsule collider. I can't see anything wrong with this anymore. Box collider + Capsule Collider = No collision?

These colliders definitely have depth, and the rules are set up properly for collision. I'm stumped.

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by fafase · Apr 11, 2014 at 07:29 PM

The error you get comes from the fact that some parts of your model are just planes and a plane is just a geometric entity, totally flat. The collider (in 3D) needs be a volume. So when generating the automatic collider based on mesh, some parts are not volume and collision may not be detected.

I think you would be better creating the collision box manually, at least where you do not need extra precision. Just add some box colliders and make them match the mesh. It won't be as precise but you probably do not need it. On top of that, it is way faster to use boxes than any mesh collider.

Comment
Add comment · Show 7 · 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 Mystic 2628 · Apr 11, 2014 at 08:50 PM 0
Share

Does that mean that if i extrude the walls of the ring slightly inwards until they do have depth, they will collide correctly? If so, it won't be too hard.

avatar image fafase · Apr 11, 2014 at 08:53 PM 0
Share

I don't quite get what you mean but if that includes giving volume then yes, that should help. A simple way to know s to get inside of the building, if you see through the walls, it means your walls are planes and Unity is culling the back of it by default. So what you need is to change those planes for cube even with a little thickness so that unity can make a bounded volume.

avatar image Mystic 2628 · Apr 11, 2014 at 08:54 PM 0
Share

Also, what if i applied a 2D collider? Seeing as a plane is 2D?

avatar image fafase · Apr 11, 2014 at 08:55 PM 0
Share

You shouldn't mix 2D and 3D as they are separate physics engine in Unity. So you would not be able to collide 2D with 3D.

Also, you should post those as comments not as answer, that would skip the moderation and is more appropriate to what they are.

avatar image Mystic 2628 · Apr 12, 2014 at 04:20 PM 0
Share

But when I used sketchup, i designed the walls of the arena so that they already had volume. They were empty inside but on each side of the empty space in the middle were walls, so i'd assume Unity would fill the gap and say "Ok. Four planes on each side and a top and bottom plane? That's a rectangle" ins$$anonymous$$d of just assu$$anonymous$$g the walls are four planes placed side by side.

Show more comments

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

23 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

Related Questions

Simultaneous Multi-Platform Development Workflow and Best Practices 5 Answers

turning import renderer off 1 Answer

Maya import help 0 Answers

share or reassign materials 0 Answers

Custom Fonts... Missing on friend's computer 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