Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 David92 · May 18, 2017 at 12:36 AM · 2dcollisionmovementboxcollider

GameObject B does not collide with GameObject A

Hello guys,

I have a 2D game where A attacks B and then B attacks A (turn-based). A attacking B works fine, but B attacking A has issues - read the issue part for explanation.

MY ISSUE:

GameObject A walks towards GameObject B. It collided with B normally and performs action OnTriggerEnter. Now the same thing should occur with GameObject B. GameObject B walks towards GameObject A. It DOES NOT collide where the actual boundaries of BOX COLLIDER are (both use two Box Colliders, one for actual collision, other one for IsTrigger events). But it stops in the middle of GameObject A, crashing to it for few times and stops.

BoxCollider boundaries are set OK. Even if I make them bigger, the first scenario (A -> B) works as expected (will stop even sooner, because of bigger collider on B), but vice versa (B -> A) won't work and same scenario happens (B will walk to center of A and keep hitting to that point few times and stop).

SCENARIO:

alt text

I don't know what I am doing wrong. I think I might be missing something related to 2D Physics of using BoxColliders.

scenario.png (8.3 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 Claddish · May 22, 2017 at 03:27 AM 0
Share

Could you post your code for the two GameObjects please, I think I had the same issue in the past @$$anonymous$$92

avatar image RobAnthem · May 22, 2017 at 03:29 AM 1
Share

You have 2 separate gameobjects for each collider object, and a separate script to handle each, correct?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by damiano201 · May 22, 2017 at 07:33 AM

Are you using Rigidbody2D? I believe this component should be added to both objects. It looks like your issue might occur because Game Object B doesn't have Rigidbody2D.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Moving a player smoothly without breaking collisions? 2 Answers

Make characters go through each other 1 Answer

Smooth Collisions 2D 0 Answers

No Collision in 2d Scene 0 Answers

Sphere overlaps vertical box collider and stutters 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