|
(note: I barely get by with scripting and dont know what alot of things mean, so you may have to go into more detail if i ask) I was wondering if i could use a button to toggle the visibility of the mouse. I am using the First Person Controller Prefab, and i've added in the mouse look script Screen.showCursor = false; right after the void update and the mouse is gone. now i just recently realized that the mouse look script is not in java. i was wondering is there anyway i can use a different java sheet to say something like (and this is not a working java script at all, its just a very VERY rough example) var Toggleme:boolean; and then say some where that if that var is true, then run the mouse look script, so the mouse will be gone and moving the mouse controls looking, but if you hit the button again, it will be false and the mouse will appear, and moving the mouse will only allow you to click some things on the GUI and not move the screen. if someone could please write down the java script and/or explain how it works and stuff then please do
(comments are locked)
|
|
There are 2 mouse look scripts that come with your first person controller. You would have to turn on/off both. If you want to toggle mouse visibility and mouselook then try the following: tried this one first, very simple and thank you it worked. to others who answered thank you as well
Feb 15 '10 at 10:08 PM
Adam Bruns
(comments are locked)
|
|
basically you should add 2 statements to your script.
you should use GetComponent like this
then you should use ml.enabled rather than this.enabled. if the MouseLook is in another gameObject use what sebas provided with your GameObject name.
(comments are locked)
|
|
basically you should add 2 statements to your script.
you should use GetComponent like this
then you should use ml.enabled rather than this.enabled. if the MouseLook is in another gameObject use what sebas provided with your GameObject name.
(comments are locked)
|
