- Home /
Access others functions C#
Hi ! Is there a syntax to acces to another "funtion" in unity ?
This is my code :
void OnCLick() {
Bonjour();
}
void Bonjour() {
Debug.Log("OK");
}
But it's dont work. Is there a specific function to acces others functions ?
Thanks
Answer by Meltdown · Jan 10, 2013 at 06:30 PM
Unity uses C#, so your code above should work no problem.
Although I fear it may not work since you have a capital 'L' on OnCLick, it should be OnClick()
The 'L' is definitely part of the problem.
Furthermore, there is no builtin function "OnClick()". @ghostGeekgame: To react to mouse clicks, you'd usually do something like in this example: http://docs.unity3d.com/Documentation/ScriptReference/Input.Get$$anonymous$$ouseButtonDown.html
Answer by ghostGeekgame · Jan 11, 2013 at 11:16 AM
Aargh ! Thanks you very much ! It works now !
Glad its sorted. Don't post comments as 'answers' though. Use the comment button rather for comments.
Your answer
![](https://koobas.hobune.stream/wayback/20220613090730im_/https://answers.unity.com/themes/thub/images/avi.jpg)