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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by rakesh_dev · Mar 05, 2014 at 11:43 AM · collisionslidingbounciness

Object is sliding off instead of bouncing!

Hi guys i need some help in setting up this physic properties in unity. I am trying to make a air hockey game and i opted to use physics properties on walls and a puck. But i dunno why some times the puck slides off the walls even the the property is set to 1 (i mean the bounce)and when it has more velocity then only it is bouncing off those walls. alt text

As you can see that white puck is stuck to those walls(invisible colliders).And one more thing is how do we actually move the player with mouse when the camera is angled? the one i did with ray casting is actually not looking really impressive Please any help would be really helpful thank you.

fordevs.png (32.5 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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by philjhale · Apr 17, 2014 at 08:21 PM

I had a very similar problem and fixed it by reducing the bounce threshold.

Edit -> Project Settings -> Physics

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 bastischo · May 26, 2014 at 09:49 AM 0
Share

This helped me tremendously. It exactly fixed my problem in a pong-like game

avatar image
0

Answer by Lordinarius · Mar 05, 2014 at 01:04 PM

Instead of using physics properties, I think you should make your own calculation.

You have 4 walls (Right, Left , Up, Down)

If your puck collides with right or left walls you can simply inverse X axis of puck's velocity. And if the puck collides with up or down walls Y axis should be inverted.

Example Code

 Vector3 myVelocity = puck.rigidbody.velocity;
 myVelocity = new Vector3(-myVelocity.x,myVelocity.y,myVelocity.z);
 puck.rigidbody.velocity = myVelocity;
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 rakesh_dev · Mar 07, 2014 at 05:16 AM

Hi lordinarius the issue is with colliders and it is happening because of the puck is hitting the walls and its getting stuck there instead of bouncing.

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 Lordinarius · Mar 08, 2014 at 03:19 PM 0
Share

Unity physic egine sometimes is not working properly. If your object's speed is too high, sometimes objets passes through colliders. In order to overcome this issue, you should make your calculations with using raycasting

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

Unity 5: Mecanim/Animator-Driven Collision No Loner Sliding Along Walls 1 Answer

When I use Physics2D collider, Bounciness of 1 is slightly wrong. 0 Answers

3D enemies keep sliding on the terrain 1 Answer

PhysicMaterial Property Change Not Effective If Change During Collision 0 Answers

2D Slope Sliding: how to prevent with transform.translate logic 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