Little problem

Evening all I’m having a little problem making scripts add components, I have followed the tutorial and done the scripting the ships add there own box colliders as intended, I have checked in unity gameplay and they do add the box collider as intended in the enemy.cs script

But I keep getting the below error in the console as below in the picture, I’m unsure what it could be the enemy ship prefab has no box collider on it only when the game plays and the box collider is added by the script, but when I play the game yet my ship can pass through them and the bullets don’t kill them but it did before I done this lecture and added to the enemy script to allow the enemy to add its own box collider.

I have included some pictures below one of the console error, one of the ships before game start with no box collider, and one with the ships adding box collider on game start, any help is appreciated thanks

Error


Privacy & Terms