• 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 DanielDude · Jul 23, 2010 at 07:24 PM · 2dcollisionphysicsshooter

noob colision help!

I am making a 2d shooter with a top view and... my character is a sphere. i want the sphere to collide with a wall (cube). I tried out rigid body but it just makes the wall slide or tumble.

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 equalsequals · Jul 23, 2010 at 07:43 PM 0
Share

Are you using Unity's primitives or Sphere/Cube meshes you brought in custom?

avatar image DanielDude · Jul 23, 2010 at 07:45 PM 0
Share

I'm using whatever is here: GameObject > Create Other > Cube.

3 Replies

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

Answer by Edy · Jul 23, 2010 at 07:28 PM

Remove the rigidbody component from the wall, leaving only the collider and the renderers (mesh renderer and mesh filter).

EDIT: If you are using mesh colliders instead of the default sphere-cube colliders, you must enable the property convex in both.

Comment
Add comment · Show 3 · 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 DanielDude · Jul 23, 2010 at 07:41 PM 0
Share

i tried that but the sphere goes right through the wall

avatar image Edy · Jul 23, 2010 at 10:06 PM 0
Share

Ensure that the sphere has its sphere collider, the box keeps its cube collider, and none of the colliders are marked as "Is Trigger".

Also, how are you moving the sphere?

avatar image Edy · Aug 03, 2010 at 05:48 PM 0
Share

Also, if you are using mesh colliders ins$$anonymous$$d of the default sphere-cube colliders, you should mark both of them as "Convex".

avatar image
0

Answer by Willem · Aug 17, 2010 at 06:54 PM

You can either add a Box Collider, or increase the mass of the rigid body so that its much heavier than the sphere.

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

Answer by Wotan · Sep 15, 2010 at 07:29 AM

Add a character controller to your character and move it with the move methods of the character controller. As stated before make sure that you have colliders on your character and the wall.

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.

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

No one has followed this question yet.

Related Questions

OnTriggerEnter2D working sporadically 2 Answers

2D platformer. Let player slide under object. 1 Answer

No collision detected with 2D rigidbody 1 Answer

How to make multiple objects mirror Player movement AND share collisions 1 Answer

Size and Position of BoxCollider 2 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