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
1
Question by Pitomator · Nov 02, 2013 at 01:26 PM · collisioncolliderbox

Box Edge Collision Problems

Hi, I am making a game a little like brick breaker. You shoot a ball at boxes, then the box breaks and the ball should rebound. Instead of using a sphere collider for the ball I want to use a box collider, to insure that the ball always bounces of perfectly.

Now, when I shoot the ball at the box and the point of impact is the corner the ball bounces of in a random direction and looses velocity, although I am using no friction.

alt text

I locked rotation, decreased time-steps, changed options in physics settings, tried to fix the problem with code and etc. Nothing seems to fix the problem. I am using a lot of OnCollision functions, it would be quite hard to use raycasting I believe. Because I would have to change loads of scripts. Is there a way around this? If I were to use Raycasting how would I do it? Thanks :)

problem.jpg (50.6 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 pfjarschel · Mar 27, 2015 at 06:03 PM 0
Share

Did you ever find a solution to this? I'm having a similar problem...

avatar image Pitomator · Mar 31, 2015 at 12:22 PM 1
Share

I came up with a work around, at the end I wrote a piece of code that detects where the box collided (the contact point) and then I changed the velocity accordingly.

So, if I detected a collision on the top/bottom half, I inverted the vertical velocity of the object.

And if I detected a collision on the left/right side, I inverted the horizontal velocity.

I believe the new Unity 2D options solved this problem though. Good luck developing!

avatar image pfjarschel · Mar 31, 2015 at 12:32 PM 0
Share

Yeah, that's the only solution I could think of, but my game is in 3D, so It's getting a little more complicated. The main problem is when the ball hits the point between two or more blocks...

Thanks for your answer, though! =)

avatar image Masherak · Mar 31, 2015 at 01:02 PM 0
Share

What will happen If you enclose 100% bouncing material to the collider ?

avatar image pfjarschel · Mar 31, 2015 at 01:22 PM 0
Share

Still the same, $$anonymous$$asherak...

0 Replies

· Add your reply
  • Sort: 

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

17 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

Related Questions

Cubes wont Collide 1 Answer

Unity Collison Problem 1 Answer

how do i correctly use a box collider 1 Answer

Internal collisions 1 Answer

Rigid Body and Collision practice 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