Unity Compiler/Monodevelop Corrupted?!

Hi guys,

Im currently working on my project and consisting getting errors that the compiler is functioning as it should…

at the moment i have this:

Help would be greatly appreciated as i dont want to have to reinstall unity…

you’re missing the last parameter on BroadcastMessage…

you need one of these:

How do i get one of those and where do i put them?

BroadcastMessage ("ApplyDamage", 5.0);

is the same as:

BroadcastMessage ("ApplyDamage", 5.0, SendMessageOptions.RequireReceiver);

since the default is SendMessageOptions.RequireReceiver. This will throw the error you’re getting if the gameObject you are broadcasting to doesn’t have the function being broadcasted.

Or you can use:

BroadcastMessage ("ApplyDamage", 5.0, SendMessageOptions.DontRequireReceiver);

if you don’t want it to error if the gameObject you are broadcasting to doens’t support the function being called (i.e. ApplyDamage in this case).

Ideally you’re code should not allow the broadcast on an object that doesn’t support that function call… hence the default being “throw error”.

Ive managed to work out the broadcast error, any idea on the first warning? The reference to monodevelop kinda throws me off :\

not seen it before, but it looks like it something caused by a typo… maybe something like a GetComponent(typoInHere)? that kind of thing would be my guess.

SOLVED was a prefab that had the scripts removed.

Cheers guys