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 oleg9419 · Feb 28, 2014 at 03:44 PM · collisioncolliderkinematicbox

Rigid Body and Collision practice

Hello , I would like to hack and slash through my 2D enemies sprites and I am confused how should I manage their rigid bodies and colliders so that the collision is accurate because the animation of my player is going to be fast.

So how would an expert do that ?

Thank you :)

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
0

Answer by DanielRS · Feb 28, 2014 at 08:13 PM

Hello, that happens because the colliders are going too fast, here's an example:

Player is at position <0,0> and moves horizontally by <4,0> each frame. Now, you have an enemy at <6,0>, here's the flow of the game:

  1. Player at <0,0> game starts

  2. Player at <4,0> no collisions detected

  3. Player at <8,0> no collisions detected

As you can see, the player ignored the enemy position, because between each frame, the player moved past the enemy, not triggering the collision.

The way to fix this is to set the "Collision Detection" property in the Rigidbody component to "Continuous" or "Continuous Dynamic" depending on your needs.

Check the Rigidbody component page for more information

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 oleg9419 · Feb 28, 2014 at 08:35 PM 0
Share

Thank you , I understood that . But I would like to know if attaching a trigger collider2D and a kinematic rigidbody2D body to all the weapons in the game is a good practice ?

PS : $$anonymous$$y enemies and the main player have already a non kinematic rigidbody2D, so that they are influenced by unity phys engine.

avatar image DanielRS · Feb 28, 2014 at 08:48 PM 0
Share

@oleg9419 I don't think is a bad practice, but you will have to move the $$anonymous$$inematic rigidbodies using Transform. Check this page for more information.

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

21 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

Related Questions

Collider going through walls with box collider.. 1 Answer

Box Edge Collision Problems 0 Answers

Can Kinematic Object collide with other Kinematic Object? 1 Answer

What is the cheapest way to prevent object A from going through object B 3 Answers

Preventing objects from intersecting with minimal physics 3 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