79701103

Date: 2025-07-14 15:51:20
Score: 3
Natty:
Report link

Have you considered that the gameobject might have a Collider attached, and not a Collider2D? Because when there is a (3D) Collider component already, AddComponent<Rigidbody2D>() returns null. You have to call AddComponent<Rigidbody>() then!

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Neo