0
\$\begingroup\$

My Player just goes through stuff he actually shouldnt be able to go trough like enemies or map borders, which all have collider components attached to them.

It's really annoying because I haven't changed anything and sice yesterday, but it isn't working anymore. It's especially annoying because Enemies cant even hit me anymore.

Is there a better way to use colliders? I would be really thankful for some help on that. If you need more specific infos just write comment.

\$\endgroup\$
3
  • \$\begingroup\$ Your player has collider and a rigid body of the matching type? You didn't change anything in the collision matrix? How do you move the player? \$\endgroup\$
    – Zibelas
    Jan 8, 2023 at 12:13
  • \$\begingroup\$ You have not given us enough information to diagnose this problem. Please edit your question so that it contains a Minimal Complete Verifiable Example of the problem. That is: every line of code and step of scene setup instruction that a reader would need to follow to reproduce this problem in a new, empty project. Once we can reproduce the exact issue you're having, we can test potential fixes to be sure they'll work for you. \$\endgroup\$
    – DMGregory
    Jan 8, 2023 at 13:21
  • \$\begingroup\$ You may also want to look at past Q&A like Object goes straight through game object without colliding, Car driving through walls with transform.Translate(), etc. Common contributors are missing Rigidbodies, moving objects with the Transform component instead of the Rigidbody component, mixing 2D and 3D colliders, colliders set as "Is Trigger", kinematic bodies being used to disable automatic collision resolution, etc. We'd need to see your implementation to know which causes are relevant. \$\endgroup\$
    – DMGregory
    Jan 8, 2023 at 14:20

1 Answer 1

1
\$\begingroup\$

The problem was simply because my Rigidbody2D was set to be Kinematic, which led to it being totally immune to physics interaction, meaning it could not collide with anything.

To fix this issue, just set your Rigidbody2D (back) to Dynamic.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for your edit. After a short delay you'll be able to mark this answer as "Accepted" by clicking the ✅ icon in the top left, to signal to other users that this answer correctly solves the problem. \$\endgroup\$
    – DMGregory
    Jan 8, 2023 at 17:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .