• 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
1
Question by Fred_Vicentin · Dec 18, 2014 at 09:00 PM · rigidbody2dcollider2dboxcollider2d

Box Collider 2d don't collide

I'm simply putting a sprite with Box Collider 2D and Rigidbody2D on ground with box collider 2d, the sprite transpass the object, I dont know if this is a bug of my unity because this is a really idiot and noob question.

The only warn that appear is "The Collider did not create any collision shapes as they all failed verification.This could be because they were deemed too small or the vertices were too close. Vertices can also become close under certain rotations or very small scaling"

I scaled so much times bigger and smaller, checked everything, why this dont work ?

EDIT:[WHAT THE HELL ???] When I start the scene with crate (see my another post below) as isKinematic and click play, if I desactive isKinematic the collision works ! If I start the scene with isKinematic disabled it transpass the object

Comment
Add comment · Show 8
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 MrSoad · Dec 19, 2014 at 01:52 PM 1
Share

Not sure if this will help with your problem but it is worth a try :

http://docs.unity3d.com/ScriptReference/Rigidbody.WakeUp.html

avatar image Fred_Vicentin · Dec 19, 2014 at 01:57 PM 0
Share

I'm laugting here $$anonymous$$rSoad, I tested what you said, It dont worked but I found the problem, Unity is not recognizing Rigidbody2D check this error message when I add the WakeUp: $$anonymous$$issingComponentException: There is no 'Rigidbody' attached to the "box" game object, but a script is trying to access it. You probably need to add a Rigidbody to the game object "box". Or your script needs to check if the component is attached before using it.

avatar image MrSoad · Dec 19, 2014 at 02:00 PM 1
Share

Should have given you this link rather than the one above, the one above if for 3D not 2D. Give this a try :

http://docs.unity3d.com/ScriptReference/Rigidbody2D.WakeUp.html

avatar image Fred_Vicentin · Dec 19, 2014 at 02:00 PM 0
Share

Another weird thing, If I put gravity scale 0.1 on Rigidbody 2D it works, Its like "Object is too fast at normal speed" The normal gravity Scale is 1

avatar image MrSoad · Dec 19, 2014 at 02:06 PM 1
Share

What is your actual scale, put a std Unity cude (3D) in your scene. If it looks huge then you have your whole scale far to small. The cube is 1m in diameter but the physics engine does not like it when small things are modeled at their real life size (a pool table and balls will not work well at the correct real life scale). So it is best to try and have your main objects, player etc, at around the size of the std Unity cube.

Show more comments

2 Replies

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

Answer by BenZed · Dec 18, 2014 at 10:39 PM

Typically, when you place a BoxCollider on a sprite, it expands the box to fit the sprite. The question here is why it isn't doing that. Is your sprite transparent?

In any case, you can set the collider bounds manually in the inspector.

I've uploaded a working example, use it to compare what's going wrong.


boxcolliderobject.unitypackage.zip (335.7 kB)
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 Fred_Vicentin · Dec 19, 2014 at 01:33 PM 0
Share

Its not transparent, I applied box collider 2d on the ground and box collider 2d + rigidbody 2d on your crate and dont worked

avatar image
0

Answer by Fred_Vicentin · Dec 19, 2014 at 01:37 PM

My sprite is not transparent, I can see the collider, but it transpass object EDIT:[WHAT THE HELL ???] When I start the scene with crate as isKinematic and click play, if I desactive isKinematic the collision works ! If I start the scene with isKinematic disabled it transpass the object Check what I done alt text alt text

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 Fred_Vicentin · Dec 19, 2014 at 01:38 PM 0
Share

Nothing Wrong right ?

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

30 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 avatar image

Related Questions

2D Colliders bug. 1 Answer

2DColliders going through eachother 1 Answer

My player is unexplainably destroyed when collides with a collider 0 Answers

Best solution for making arc collider 0 Answers

2D Physics Problem? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges