On line 11 I try to call the script PlayerCustomizationMenu ,but it won’t take the return value of void. The error goes as so: Assets/Scripts/mainMenuOptions.cs(11,46): error CS1525: Unexpected symbol
)', expecting .’
and here’s the script
public class mainMenuOptions : MonoBehaviour
public bool mMOOn = false;
public GUIStyle optionsButton;
void Start ()
void Update ()
if(GUI.Button(new Rect(100,100,250, 50),"Options", optionsButton))
if(mMOOn == false)
mMOOn = true;
pCMOn = false;
sBroOn = false;
You cant pass void as a function parameter.
If the function is ment to accept a parameter but you want that value to be nothing, just pass a default or unaccepted value and check for it in the function.
If it accepts no parameters then what your trying to do in theory is the same as the following.
You may check out:
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
I believe it expands upon what your question is about.