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 TrumpetDude · Aug 26, 2017 at 11:48 PM · 2dcollisioncolliderrigidbody2d

There seems to be a collider when there shouldn't be

I already asked about this in the forum, but I wasn't sure where the best place for this was, so here is my question:

I have a sprite for the player that has a box collider and a Rigidbody2D attached, and a box collider attached to the seafloor, a cube. What I would like to happen is for the player to be able to continue swimming normally, but not through the seafloor.

This is not what happens, though. The player sprite plummets to the seafloor (it did not do this before I added the collider) despite the gravity scale on the Rigidbody2D being 0. After doing some research on this, I suspected that it was because it is occupying the same space as a collider in the background game object which I can see when I put the scene in wireframe view. The issue is that the game object that makes the background (EasyWater2D from the asset store) does not have a collider component at all.

Also, that might not even be the issue, because when I take away the background, the exact same thing happens despite there being no visible colliders. I am quite mystified. Any ideas on why this is happening and/or how to fix it?

Comment
Add comment · Show 4
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 TheSOULDev · Aug 27, 2017 at 12:23 AM 0
Share

Could you share your seabed collider? Also, why are you using a box collider ins$$anonymous$$d of terrain collider?

avatar image TrumpetDude · Aug 27, 2017 at 09:35 PM 0
Share

@TheSOULDev What do you mean by "share" the collider? I don't know how to use a terrain collider yet, but as of right now the seabed is completely flat so it seems like a box collider should be O$$anonymous$$.

avatar image TheSOULDev TrumpetDude · Aug 27, 2017 at 10:59 PM 1
Share

If you have a problem with something, you should post on how that something is set up in the game. Therefore, you in this case you need to post how your collider is set up (preferably by a Unity editor screenshot) so we could see how it acts.

As for the terrain collider, as you are using a seafloor, which is terrain, you should learn how to use the terrain collider. It's simply a collider that follows the shape of a mesh, so it's fairly useful because of its precision and simple implementation. Although, because you use 2D you cannot use it, so in that case, you'd use a Polygon collider. Now, because you said you were using a cube, I HOPE you didn't use a 3D Cube collider for 2D object collision, because that simply won't work. If you're using a box collider, make sure that the edges are in the same Z coordinate as the player, otherwise they cannot interact.

avatar image TrumpetDude TheSOULDev · Sep 01, 2017 at 11:23 PM 0
Share

@TheSOULDev Thanks for the pointers. I'll look into terrain colliders and make sure everything I'm using exists in the same number of dimensions.

1 Reply

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

Answer by TrumpetDude · Sep 01, 2017 at 11:21 PM

Well, despite my obvious lack of understanding when it comes to colliders, I managed to figure out what was causing the problem. For whatever reason, my camera had an edge collider on it that was hitting my ship's collider, and when I removed this, the problem was fixed. Thanks anyway though!

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

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

Related Questions

Unwanted results from 2D collisions? 1 Answer

Colliders in a wall jut out 0 Answers

Colliders not working when rotating 2 Answers

Multiple Stacked Colliders only register for single object 0 Answers

Adding boundaries to restrict rigidbody2D movement 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