#pragma strict

i put pragma strict so that i can verify what variables i did declare properly
for this line i get errors:

cam.currentTarget.GetComponent(Highlight).enabled=true;

this error: ‘enabled’ is not a member of ‘UnityEngine.Component’.

how to prevent this for happening?

(cam.currentTarget.GetComponent(Highlight) as Highlight).enabled=true;

Or:

cam.currentTarget.GetComponent.<HighLight>().enabled = true;

–Eric

if is C# u should write as eric…
but what’s that with as highlight?

That wasn’t C#, that was Javascript. C# doesn’t have #pragma strict (it’s always strict anyway), so there wouldn’t be any point mentioning C# in this topic.

–Eric