While Going through the FPS Tutorial, I have come across a 'MissingComponentException'

Well While Going through the FPS Tutorial, I have come across a error

'MissingComponentException: There is no 'collider' attatched to the "Launcher" game object, but a script is trying to access it.'

I have simply copied from the tutorial, and I cant come up with any suitable reason why this may be happening, any advice would be much appreciated.

Many Thanks, Soldier_Jaqqson

Well, I would guess you missed one step along the line, to attatch a Collider-Component to your "Launcher" GameObject.

Select your “Launcher” in HirarchyPane and go to Component > Physics > BoxCollider

But honestly I can't remember that the Launcher required that Component.... :-/


No, after reading up in the tutorial, I would assume the problem lies elsewhere:

   Physics.IgnoreCollision( instantiatedProjectile. collider,
       transform.root.collider );

I guess your Launcher isn't hirarchicaly attatched to your FPS-Controller-Object.

The Physics.IgnoreCollision accesses the Object wich is the very highest in your hirarchy. That’s what the “root” in the transform.root.collider-statement says.

If your Launcher were properly attatched, that would be the FPS-Controller, which indeed has a collider.

Since it’s not properly attatched, that is the Launcher, which doesn’t (and shouldn’t) have a collider.

I hope I could help.

Greetz, Ky.