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 xSmurfKasketter · May 21, 2015 at 01:17 PM · physicsrigidbodycollideroverlap

Two rigidbody's overlap instead of colliding

Hi i am making a kind of a hockey game however when i hit the puck from the side with the player they instead overlap and the puck stops. Afterwards when the player goes out from the puck it seems like the puck is added that energy, however little. Both objects have rigidbodys attached, and the player have a box collider attached, and the puck have a capsule collider attacher, former a mesh collider with the same results. Both rigidbodys have Continous Dynamic collision detection, and Interpolate is set to Interpolate.

I have tried to do it only with the physics engine, moving the player with addforce, which for some reason works, kinda, atleast the colliders don't overlap however the puck transfers most of its energy to the player and therefore more or less stops, is there a way to do this so that the puck doesn't loose energy?

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

1 Reply

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

Answer by Baste · May 21, 2015 at 01:27 PM

Are you moving your objects by setting transform.position or doing transform.Translate?

In that case, you're teleporting the objects to the new spot, and collisions won't be simulated properly. If you want to have collisions have an effect, you'll have to use physics to move the things.

If AddForce isn't working out for you, try setting the velocity directly. Also make sure that the puck and the player have sensible settings for mass - if the player and the puck has the same mass, the puck will push the player as hard as the player would push the puck.

Comment
Add comment · Show 4 · 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 xSmurfKasketter · May 21, 2015 at 01:32 PM 0
Share

Hi Baste, i think you'r right, it is probably teleporting to it. The puck is moved by using addforce, however the player is moved by setting transform.position.

If i were to move the player with addforce is there a way to stop the puck from giving all of its energy to the player without setting the players mass incredibly high? I only ask because i've tried that and it seems to make the movement quite sluggish and slow, but that may be because my speed isn't high enough?

avatar image Baste · May 21, 2015 at 02:32 PM 0
Share

Try setting the puck's mass to almost nothing.

Also, post replies to answers as comments, not answers! I converted your answer to a comment for you. Answers are supposed to be solutions to the original question.

avatar image xSmurfKasketter · May 21, 2015 at 02:58 PM 0
Share

I will try that in a bit, thank your for your response.

Sorry, you'r right forgot that i should use the comment feature :)

avatar image xSmurfKasketter · May 21, 2015 at 05:18 PM 0
Share

i set the mass to very little and just adjust the position, it will always move it a little bit i guess, thanks for the help

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

20 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

Related Questions

How to prevent collider overlap during prefab replacement 0 Answers

Ignore sub-colliders for center of mass in Rigidbody2d? 1 Answer

Tossing an object with the correct force at any distance from another so that it collides with the other 1 Answer

Gravity is preventing object from moving straight toward its direction when calling rigidbody.AddForce... 1 Answer

Camera gets flung off of the map when the player collides with certain objects. 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