|
I have a quiz type game in which you walk up to a door, get asked a question, and if you get the question right the door gets destroyed and you move on. If not it locks and you have to find a way around. Currently everything works fine with the exception then when your picking your answer the mouselook is spinning your character around. I've gotten it so I disable the mouseLook script on entering the trigger but if the person gets the question right and the wall gets destroyed, onTriggerExit never gets called to turn the mouseLook script back on. Any ideas?
(comments are locked)
|
|
First, make sure you are using the correct
If you are, then why don't you try re-enabling the MouseLook script in the same function where you destroy the wall? That would seem more logical, unless you use I'm still trying to learn how to change a variable on one gameObject script with a script from a different gameObject. IE: Disabling mouselook on the FPS controller with a script attached to the trigger. Perhaps thats the core of my problem that I need to learn.
Aug 31 '10 at 06:16 PM
Will 11
You could use GameObject.Find("First Person Controller").GetComponent("MouseLook").enabled = true; to disable a MouseLook script attached to a GameObject named "First Person Controller".
Aug 31 '10 at 06:54 PM
BinaryCaveman
(comments are locked)
|
