Error: Instantiated Enemies don't get hit

So im spawning enemy prefabs in random locations (donut spawn) around the player.

When the player shoots the enemy, the bullets go right through them. The collision doesnt occur.

I did:

GameObject enemy = (GameObject) Instantiate(Resources.Load("Enemy"), SpawnVector(5,15), Quaternion.identity);

It works fine when I drop the enemy in through the editor and run the game.

Please Help!

I couldn’t find a solution using search.

Try adding a rigidbody on your bullet. If your bullet is a trigger, you may need to check the “is kinematic” box.

Try adding Rigidbodies to both, the bullet prefab and the enemy prefab.