I keep getting the error
"**Cannot convert System.Type to UnityEngine.Color** "
I’m trying to create a custom cursor that should change color when it moves across an interactive object.
I have the cursor operating but changing color is an issue.
The code is originally from a Lesson Book taht i am working my way through called
" 3D Game Development with Unity"
I’ve read a lot of threads here but nothing seems to explain this issue…
Any help would be really appreciated… I’ve been at this for hours…
Here’s the code I have written so far…
var controlCenter : GameObject;
private var mouseOverColor : Color;
function Start (){
guiTexture.enabled = false; // disables the cursor on startup
mouseOverColor = controlCenter.GetComponent(GameManager).mouseOverColor; //ref.p276
}
function Update () {
// gets the curent cursor position
var pos = Input.mousePosition;
// feed its x and y pos back into the GUI Texture cursor objects params.
guiTexture.pixelInset.x = pos.x;
guiTexture.pixelInset.y = pos.y - 32; // offset to top
}
function CursorColorChange (colorize: boolean){
if (colorize)
guiTexture.color = mouseOverColor;
else guiTexture.color = Color.green;
}
// END OF CODE