question

Sai Arjun K avatar image
Sai Arjun K asked

Unity Editor throwing an error ClientAPI does not exist in the namespace PlayFab.

So I use PlayFab for multiplayer, and I currently have a basic login script which is supposed to create an anonymous user, but when i try to call it using

PlayFab.ClientAPI.LoginWithCustomIDRequest(params);

The Unity Editor give an error stating that ClientAPI does not exits in the namespace PlayFab.

Here is the full error log in the console

Assets\Scripts\PlayFabManager.cs(22,9): error CS0234: The type or namespace name 'ClientAPI' does not exist in the namespace 'PlayFab' (are you missing an assembly reference?)

I have tried both enabling and disabling the ClientAPI via the PlayFab Extension in the Unity Editor, but I still get the same error.

Can someone please help me with this?

Part of the Script concerned with login:

Extension:

apismultiplayer
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sai Arjun K avatar image Sai Arjun K commented ·

It seems that the Screenshots did not get uploaded here, so here is the text form:

var request  = new LoginWithCustomIDRequest
    {
         CustomId = SystemInfo.deviceUniqueIdentifier,
         CreateAccount  = true
    };
    PlayFab.ClientAPI.LoginWithCustomIDRequest(request, OnSuccess, OnError);
0 Likes 0 ·

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

It should be PlayFabClientAPI.LoginWithCustomID. You can refer to Quickstart: PlayFab Client library for C# in Unity to get started with Unity.

PlayFabClientAPI.LoginWithCustomID(request, OnSuccess, OnError);
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.