Problem with Mobile Control Add-on

Support for MFPS 2.0 (for verified users)
Forum rules
To request support/assistance for MFPS, you first have to verify your purchase by sending your purchase invoice number to Lovatto in a PM.
Post Reply
User avatar
hersa
New Member
New Member
Posts: 7
Joined: Fri Jul 31, 2020 9:04 pm

I have purchased and used the mobile control addon. I've imported and enabled it, but I can't make it integrated because the "integrate" tool in the MFPS menu is disabled. Actually the addon works fine, but when the game is paused or the score UI is showing the mobile control UI keep appear (not hidden)
User avatar
hersa
New Member
New Member
Posts: 7
Joined: Fri Jul 31, 2020 9:04 pm

Hello, is there any solution for my problem?
User avatar
tr0picana
Contributor
Contributor
Posts: 1
Joined: Sun Sep 27, 2020 8:55 pm

This is how I fixed it, not sure if it's the best solution.

All code is in bl_UIReferences.cs

1. Add a public GameObject representing the Mobile UI object:

Code: Select all

public GameObject ChatInputField;
public GameObject MobileUI; //New variable
[SerializeField] private Button[] ClassButtons;
[SerializeField] private GameObject[] TDMJoinButton;
    
2. At the top of function SetUpUI():

Code: Select all

if(MobileUI == null)
{
  GameObject mui = GameObject.Find("MobileControls");
    if(mui != null)
    {
      MobileUI = mui;
    }
}
3. At the top of function ShowMenu(bool active):

Code: Select all

if (MobileUI)
{
  MobileUI.SetActive(!active);
}
4. At the bottom of function JoinTeam(int id):

Code: Select all

if (MobileUI && !MobileUI.activeInHierarchy)
{
  MobileUI.SetActive(true);
}
User avatar
hersa
New Member
New Member
Posts: 7
Joined: Fri Jul 31, 2020 9:04 pm

Great! it worked. thank you very much tr0picana
Post Reply