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 WesterlyCarrot9 · Jul 17, 2014 at 08:09 PM · 2dcollisionrigidbodyspritecharactercontroller

2D Collision Between Sprites

Ok so i have two sprites, the one's supposed to be the player and has a character controller attached to it which is used by the movement script, and the other is just a box i want the player to collide with. I've used both 2D rigidbody and colliders but there is no collision. Any ideas?

Comment
Add comment · Show 6
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 Domo23000 · Jul 17, 2014 at 08:16 PM 0
Share

Are you using 2d or 3d colliders? If you use 3d and the z axis are different, then maybe that could be the problem

avatar image WesterlyCarrot9 · Jul 17, 2014 at 08:21 PM 0
Share

As i said above i tried 2D rigidbody and colliders :)

avatar image Pyrian · Jul 17, 2014 at 08:40 PM 0
Share

Lots of things can prevent collisions, but the one that usually catches new people is the fact that collisions won't prevent position sets or translates. So, if you tell the Rigidbody2D to translate a set distance in a given direction, it doesn't matter if there's a collider in the way, it's going to do it.

avatar image tarun6177 Pyrian · Jun 22, 2016 at 04:08 PM 0
Share

@Pyrian , i am having the same problem and ive set the rigidbody2d to translate in forward direction. so how can we achieve the collision or how can we attach a trigger or a switch to this situation.

avatar image tanoshimi tarun6177 · Jun 22, 2016 at 07:34 PM 0
Share

If you want the physics engine to be responsible for movement and collision, set the velocity or apply forces to the Rigidbody2. If you want to use Translate to move your object you're basically ignoring the physics system, so you'll need to create your own collision detection and response.

avatar image $$anonymous$$ · Jul 17, 2014 at 08:49 PM 0
Share

Also be sure that collider might be different (in terms of size) then the sprite seen. Collider has it's own borders.

0 Replies

· Add your reply
  • Sort: 

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

25 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

Related Questions

Unity 4.3 CharacterController collision with physics 2D not working 1 Answer

Any way to ignore collision between rigidbodies and colliders/character controllers? 1 Answer

Character Controller meets Rigidbody 1 Answer

Make characters go through each other 1 Answer

Collision detection not working properly with 2D sprites 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