2 years ago

#56776

test-img

Alexander Tukanov

UIFakeStoreWindow error: Can't add component 'Transform' to UIFakeStoreWindow

I have IAP version 4.1.2 and simple 2D project.

I get the error Can't add component 'Transform' to because such a component is already added to the game object when I click on IAP button, but the script still works anyway.

I have only one IAP button, in a success case it should print to the console the text Works otherwise Error.

See my hierarchy: enter image description here

ScriptObject is a just empty game object with attached c# script Test, which contains only two methods:

class Test : MonoBehaviour
{
    public void PrintOk()
    {
        Debug.Log("Works!");
    }
    public void PrintError()
    {
        Debug.Log("Error!");
    }

}

ButtonIAP is a simple IAP button which should print to the console simple text (Works or Error) depends on was the click action completed successfully.

enter image description here

So when I click the IAP button the program output to the console

Can't add component 'Transform' to UIFakeStoreWindow because such a component is already added to the game object!
UnityEngine.EventSystems.EventSystem:Update ()

After it UI fake store window appears and if I click YES option PrintOk method is invoked and the program output the the console Works

enter image description here

So the problems are:

  1. what does the error mean?
  2. why does it appear?
  3. how to fix it?

unity-game-engine

in-app-purchase

0 Answers

Your Answer

Accepted video resources