Hi everyone,
I’m having trouble with this script. It was working perfectly when using Unity 4.5 but now that I have upgraded, I get the following error on the last 2 lines:
Assets/Scripts/UnitScript.js(54,55): BCE0019: ‘intensity’ is not a member of ‘UnityEngine.Component’.
Here is the script :
function HighlightSelected() {
if (menuObject.GetComponent(ClientScript).selectedObject == this.gameObject) {
var phi : float = Time.time / 1 * 2 * Mathf.PI;
var amplitude : float = Mathf.Cos( phi ) * 2;
this.gameObject.GetComponentInChildren(Light).intensity = amplitude;
targetDestination.GetComponentInChildren(Light).intensity = amplitude;
}
}
Any help will be appreciated ![]()