|
Is there a code allowing me to add a custom mouse cursor for my game? If so, an example would be nice.
(comments are locked)
|
|
I use this one: Well,
Apr 16 '11 at 01:42 AM
Bunny83
You shouldn't use Input functions in OnGUI code...use Event.current instead, then you don't have to convert screen coords to gui coords.
Apr 16 '11 at 03:14 AM
Eric5h5
I used his code and it worked! Thanks, everyone!
Apr 24 '11 at 08:49 PM
SpeedySpikes
Good, now can any of you tell me how I can create an animation that loops and changes the cursor size (Bigger, then smaller, then repeat)?
May 06 '11 at 09:38 PM
SpeedySpikes
click on your cursor game object, then click on the animation tab. right click the scale.x under "transform" then choose "add curves". Right click on the scale.x curve and add a second keyframe a few seconds out, then drag that keyframe up a little. Press play, you will see your object get wider as time goes on. Do the same thing for scale.y or scale.z, depending on how your camera is set up. then in the bottom right, change "default" to "loop"
Jun 24 '11 at 04:17 PM
christo1745
(comments are locked)
|
|
one question why do you minus screen height
(comments are locked)
|
|
Note these techniques have been rendered obsolete by http://docs.unity3d.com/Documentation/ScriptReference/Cursor.SetCursor.html
(comments are locked)
|
|
IT IS WORK IN CENTER OF CURSOR for you
(comments are locked)
|
|
You could also use the framework: http://edrivenunity.com/cursors lol why is it latin?
Sep 28 '12 at 08:50 PM
Hybris
(comments are locked)
|
1 2 next page »

Important note: If you are implementing these code snippets listed here as a script object, it should be attached to, the last object added on any scene. Also, make sure its the very last (bottom-most) script in said object.
If you decide to put it anywhere else, Unity3D GUI order of execution applies; your mouse cursor may be rendered before any other GUI call. This potentially causes effects such as "mouse-going-under-button/label", depending on how the rest of your GUI is structured and where your other HUD scripts are.
If you add objects to your scene afterward, and any of the added objects contains a class that makes OnGUI calls, or has a GUIText or GUITexture, you will need to move the mouse cursor replacement script.