- Home /
Other
Start Screen Cursor?
Hello, I am currently trying to get a start screen cursor for my menu options, as shown below:
Right now, both of them are visible. I only want one of them visible at a time and the corrisponding one to be visible when the option is moused over. Here is the code I have so far in JavaScript. var ImageEffectOpaque : float;
function Start () {
gameObject(ImageEffectOpaque = 0);
}
function Update () {
} onMouseEnter()
ImageEffectOpaque = 100
} onMouseExit ()
ImageEffectOpaque = 0
}
}
Thie code doesn't seem to be working and I'm getting the error "Assets/Standard Assets/Character Controllers/Sources/Scripts/GemCursor.js(6,20): BCE0043: Unexpected token: ImageEffectOpaque". Can someone tell me what i'm doing wrong? I've been at this for hours and I can't seem to get it to work. :/
You code here is nonsense. And even if the changes were made to get it to compile, it won't do anything.
In the second line, 'gameObject' is not a function that can be called like your syntax implies, and ImageEffectOpaque is not a property of a gameObject.
While you've declared ImageEffectOpaque as a variable, it is no way tied to the visual cursors you are attempting to hide and sho.
On$$anonymous$$ouseEnter() and On$$anonymous$$ouseExit() are functions that need a upper case 'O' and correct bracketing.
The indentation style you have here indicates you have no idea what the lines do.
Without understanding the nature of your cursor objects, no one here can give you an accurate answer of how to show and hide the cursors.
If you are going to be writing scripts, you need to build up an understand of both the syntax of the language, and the underlying concepts of how to do particular things with the language.