- Home /
No Collision in 2D Game
Hello, Im trying to make a 2D Games, wehre a Guy is flying from the left to the right and has to prevent hitting some objects. The Character is a sprite with a Box Collider the Obstacles are so too. I tried it with 2D colliders and 3D colliders but non of them is working not even with a trigger. I also used OnTriggerEnter2D and OnTriggerEnter. The Character doesnt have a Rigidbody on it its just moving by rising its x Position.
No Combination worked for me now. Hope someone can help me. Mfg DasFloX
Answer by Omberone · Jun 29, 2014 at 06:50 PM
You need a Rigidbody or Rigidbody2D component for it to be able to register collisions. If you don't want it to affect gravity, there's a tick-box for that.
Answer by Rainbowlicious · Oct 15, 2020 at 04:05 PM
This is on top of Google search, so for anyone who still has this problem even with Rigidbody2D: Go to Physics2D ProjectSettings (Edit -> Project Settings) and look at Layer Collision Matrix. It may be that your game objects are on two layers that do not interact with each other.