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 BennyXUNITY · Apr 12, 2020 at 01:45 AM · collisioncollidersmeshcollidercompound collider

Colliders for holes and diagonal shapes (Newbie),Which collider do I use?

So, we decided to make this little game where the players play pool, but instead of a white ball they have little cars that are shot at the balls directly. I've been trying for a few days now, I can't for the love of god figure out which collider to use for the pool table. We have a visual version of the pool table, and a simpler version I created in blender to try and get a working mesh collider for the stage. SPOILER: it's not working. Problem is that for some reason players are still able to glitch through the wall easily. I'm relatively new to unity. I thought about just using a compound collider, but creating them in unity for the whole table manually would take me ages and I can't figure out how to handle the different diagonal shapes and ground around the holes, which has these curves, since I can't rotate the colliders. Any of you have any tips? Am I missing something?!

alt text

table.png (213.5 kB)
table.png (148.4 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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by streeetwalker · Apr 12, 2020 at 08:39 AM

Hi @BennyXUNITY , Interesting game Idea!

There could be a number of reasons for collisons "glitching out" One is relative velocity of the object with respect the the size of the collider. Objects that move to far in any given frame can overshoot the collider, missing it entirely. There are a number of ways to try to compensate for that.

Explain how do you want it to behave, in separate details:

You want your objects to realistically bounce of the table rails?

What about the pockets - do you want the cars to bounce out of a pocket if it hits too hard?

It looks like you are trying simulate what happens to balls once they go down into a pocket? Explain how you imagine that happening, and why you'd want to!

From there, what are you trying to do with diagonals?

I have to add, you don't want colliders for "hole" of the pockets - you want triggers, because you don't want the object to bounce off the "hole". Now if you want the concave area around the hole to behave as a true billiard table, that is a different story.

Comment
Add comment · 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
0

Answer by BennyXUNITY · Apr 12, 2020 at 04:21 PM

@streetwalker Hey, thanks for the quick answer. I actually would like the sides to behave like a normal pooltable with balls bouncing off, but I haven't really thought about how to do that yet, at the moment I'm focusing on just generally creating colliders for walls and bottom of the table that is more or less accurate to the model, so that I can test the shooting. I would like the balls to be able to bounce back from a pocket if hit too hard, but that's just for now, maybe down the line I'll think it's not as fun. My problem is some parts of the mesh collider on the sides are leaving holes for the cars and ball to be able to glitch through, which is giving me a bit of a headache. Generally manually placing box colliders in unity feels so unresponsive in the details. Like making sure the box collider for the ground is as accurate to the mesh as possible is kinda hard to do in unity.

For the holes, I already placed a big trigger collider under the stage that clip into the holes and outside of the arena. If a player or ball fall into a hole or get shout outside the stage they are placed back, no problems there.

How would you go about making colliders for the table? I can't make it from compounds, cause the balls would behave weird around the holes right?

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 streeetwalker · Apr 12, 2020 at 05:01 PM 0
Share

@BennyXUNITY, If it were me I would not try to use a compound collider, and the only place you need a mesh collider is for the rails because those are not perfectly rectangular volumes. The rails are trapezoidal because they cut an angle next to the pockets - into the pockets. The bed can be a separate box collider.

If your not worried about the rail angle next to the pockets, you could just box colliders for the rails, but it isn't as nice. Or, you could use create a simple wedge collider shape and use them for the angled portion of each rail. You won't get a realistic simulation unless you handle that angle, somehow.

the thing would be to simplify the colliders as much as possible that the rails are pretty much symmetrical on a side. So using box colliders and wedge colliders placed to fit the rail shape makes it simpler.

Also, you want to handle the overshoot problem if your car's velocity is too high - one way to do that is extend the size of the colliders back from the inner face of the rail, and using box colliders make easier - make the collider much wider than the actual rail is, and offset it so that the edge of the collider aligns with the edge of the rail.

For the pockets, use cylindrical colliders set as triggers.

Put the all the colliders on empty game objects and align everything with your model. and parent them all together.

I think then you can let physics take over except for the pocket triggers where you actually have to check for OnTriggerEnter collisions.

avatar image BennyXUNITY streeetwalker · Apr 17, 2020 at 11:28 AM 0
Share

Thank you so much. This seems like a pretty great implementation. I will try that later and get back to you if I have some other question. Thanks so much for the in depth explanation.

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

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

Adding collision to enemy model. Please help! 0 Answers

Imported Objects falling through imported terrain and non-imported terrain 1 Answer

Ball passes through the floor on movement 1 Answer

OverlapSphereNonAlloc Not Working? 1 Answer

Terrian Collider Or Mesh Collider Which Is Suitable For Mobile 0 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