- Home /
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?
Are you using 2d or 3d colliders? If you use 3d and the z axis are different, then maybe that could be the problem
As i said above i tried 2D rigidbody and colliders :)
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.
@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.
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.
Also be sure that collider might be different (in terms of size) then the sprite seen. Collider has it's own borders.
Your answer
Follow this Question
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