Grey Zoned

Facebook SDK in Unity: Basic Login Integration Tutorial

UPDATE 18th January 2016: The new tutorial covers how to use Facebook SDK 7.3.0 to login, and get the Username and Profile Pic

As part of my Facebook integration with Unity series, I present the first tutorial.

In this tutorial I hope to show you how to get started at the most simplistic and basic level.

I don’t like all the complexity and confusion you get when you look at the official examples of Facebook’s integration with Unity. I think this puts off many newcomers or inexperienced coders to integrate this great functionality in their games.

Hopefully this tutorial will get to the point better.



I’m quite new to recording tutorials so I’d appreciate any feedback with regards to the information I’ve provided and any hints on how I can make better tutorials. (I know I say ‘whatever’ too much!)

Comments and shares are appreciated! I hope you enjoy!

Glenn Mason

Tutorial by Glenn Mason

I've been interested in Game Development since I was about 11 years old when I started by making levels for Duke Nukem 3D, later moving on to creating Half-Life and Counter-Strike maps. Once I got into coding I went down the route of learning to make websites and web applications. Now I'm a professional Web Developer, running my own freelance business. However, my heart is still in Game Development. I started using Unity late in 2013. Since then I've released two Apps on the App stores that use Unity.

Tutorial Discussion

Home Forums Facebook SDK in Unity: Basic Login Integration Tutorial

This topic contains 3 replies, has 3 voices, and was last updated by  Prabhakar G 4 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #562
    Glenn Mason
    Glenn Mason

    Please post any questions about this tutorial in here. Please remember that since this tutorial is outdated it’s better to refer to the new series of Facebook tutorials I have created. In the interest of completion this support thread is here regardless.



    Ryan Kilmurray

    Hi Glenn,

    Tutorial seems great so far but I’m currently struggling with a couple of errors. Initially I was hit with this:
    Assets/FBHolder.cs(9,17): error CS0103: The name `FB’ does not exist in the current context
    Assets/FBHolder.cs(15,20): error CS0103: The name `FB’ does not exist in the current context

    I then added (due to consensus online)
    using Facebook.Unity;

    But I’m now running into the following:
    NullReferenceException: Object reference not set to an instance of an object
    Facebook.Unity.FacebookBase.OnInitComplete (Facebook.Unity.ResultContainer resultContainer) (at Assets/Plugins/FacebookSDK/SDK/Scripts/FacebookBase.cs:217)
    Facebook.Unity.FacebookGameObject.OnInitComplete (System.String message) (at Assets/Plugins/FacebookSDK/SDK/Scripts/FacebookGameObject.cs:62)
    Facebook.Unity.Editor.EditorFacebook.Init (Facebook.Unity.HideUnityDelegate hideUnityDelegate, Facebook.Unity.InitDelegate onInitComplete) (at Assets/Plugins/FacebookSDK/SDK/Scripts/PlatformEditor/EditorFacebook.cs:79)
    Facebook.Unity.FB+<Init>c__AnonStorey3.<>m__4 () (at Assets/Plugins/FacebookSDK/SDK/Scripts/FB.cs:234)
    Facebook.Unity.FB+CompiledFacebookLoader.Start () (at Assets/Plugins/FacebookSDK/SDK/Scripts/FB.cs:864)

    Really struggling to get any kind of build. Thanks in advance, sorry if this is pretty basic; very knew to Unity and not programmed properly in over 5 years!



    Ryan Kilmurray

    Hi Glenn,

    I should point out I was using 7.5.0. Switching back to 7.3.0 and following your other tutorial seems to resolve it.

    Any idea how to get 7.5.0 working?



    Prabhakar G

    Hi Ryan,

    Just add below line at top of your script.
    using Facebook.Unity;


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.