Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
4
Question by kk93 · Feb 03, 2014 at 05:55 PM · physicsreflectbouncing

Making an object bounce off a wall the same way light bounces off of a mirror.

Hello,

I have a cylindrical object with a capsule collider with all rotations fixed and y position fixed. I want to make it so that when this object hits a wall, it bounces off at a same degree as a light bouncing off of a mirror. Just like this:

alt text

which is how Vector3.Reflect works. Unfortunately, I have learned that using the built-in physics engine, this result is not easy to achieve. Is there a known method of tweaking the parameters of physics setting to achieve this?

Thanks!

vec3reflectdiagram.png (14.4 kB)
Comment
Add comment · Show 2
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 Distant-Object · Feb 03, 2014 at 09:25 PM 0
Share

So, when you use the game engine's built in bounce physics, it doesn't work? (If you set elasticity to 1.0 and friction to zero?)

avatar image kk93 · Feb 03, 2014 at 09:40 PM 0
Share

What I did was make a new physics material with dynamic friction and static friction to zero and friction combine at $$anonymous$$imum and bounce combine at maximum. All the credit goes to the post linked below

4 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by kk93 · Feb 03, 2014 at 09:18 PM

I got an answer from unity forum.

http://forum.unity3d.com/threads/21138-Projectile-Bounce-Problem

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
9

Answer by gregroberts · Apr 22, 2015 at 01:37 PM

Just so its self contained, here is the forum answer from GargarethSunman:

If you want perfect bounces, you'll need to:

  1. set drag and angular drag to 0 on the projectile's rigidbody,

  2. create a physic material with all friction settings set to 0, bounciness set to 1, friction combine set to minimum, and bounce combine set to maximum, and

  3. put that physic material on the projectile.

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
6

Answer by GameDesignerBen · Jan 07, 2016 at 06:59 PM

I was still running into problems with this in 2D, where an object would collide with a wall and then kind of slide along it instead of bouncing off again.

I had to go into Edit -> Project Settings -> Physics2D and lower the Velocity Threshold, as any collision lower than that velocity is considered inelastic. Bumped it down a bit and suddenly everything worked like a charm.

Comment
Add comment · Show 5 · 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 dave_oak · Jan 15, 2016 at 09:40 AM 0
Share

I had the same issue in 3D with balls sliding along walls ins$$anonymous$$d of bouncing. The equivalent setting seems to be:

Edit > Project settings > Physics > Bounce Threshold.

avatar image xeeshan23 dave_oak · May 21, 2018 at 09:51 AM 0
Share

how did you sort this issue im having the same issue

avatar image ph4ntomz · Jul 29, 2017 at 06:20 AM 0
Share

This helped me! Been searching for quite a while and was already losing my sanity. Thanks for this! :)

avatar image skietsus · Jul 30, 2018 at 08:24 AM 0
Share

Thank you! Lower the Velocity Threshold and everything worked like a charm.

avatar image Rbrinks · Nov 23, 2018 at 04:51 AM 0
Share

Probably the best answer for my project.

avatar image
1

Answer by oguzkagan · May 17, 2020 at 12:13 PM

i found the solution in this video: https://youtu.be/RoZG5RARGF0

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

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

29 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

Related Questions

Issue using Vector3.Reflect to bounce a ball 1 Answer

2D 360 degress platformer example needed 0 Answers

Make an object bounce when an object is walking on it 0 Answers

Bouncing ball never becomes stationary 1 Answer

Is it possible to find the contact point of a circle collider 2D with another collider inside of OnTriggerEnter2D? 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