Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity3D meet Facebook!

Discussion in 'Made With Unity' started by mehware, Dec 17, 2007.

  1. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Seconded...
     
  2. mrswebb

    mrswebb

    Joined:
    Aug 16, 2009
    Posts:
    28

    Yes! I would love that! I was trying to figure out if you can do this with an iframe or do you have to use fbml?

    I got one step closer and got an id for my feed template for my game, but not sure where to go from there.

    I would pay for a tutorial that gave simple step by step instructions :)

    Here are some link that may be helpful


    http://developers.facebook.com/tools.php?feed

    http://developers.facebook.com/news.php?blog=1&story=51


    It looks like inserting the FB connect into the iphone game is a much easier process than the FB API's from my POV.

    http://www.vimeo.com/3616452
     
  3. MatthewScott

    MatthewScott

    Joined:
    Aug 25, 2008
    Posts:
    40
    Hi all,

    BTW, we launched this FB-Unity collaboration for the Monsters vs. Aliens marketing campaign back in February.

    http://apps.facebook.com/monstercreator

    It even allows you to save custom monster photos to your profile and send them to your friends.

    Thanks,
    Matthew Scott
    Manifest Games
     
  4. cry0

    cry0

    Joined:
    Apr 9, 2009
    Posts:
    71
    wicked :)
     
  5. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    yeah I'm interested also... is there a tutorial on how to do this ?
     
  6. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
  7. Frieza

    Frieza

    Joined:
    Aug 29, 2008
    Posts:
    68
    I have a small problem with integrating nicely with facebook. My app sits ontop of everything else. I assume this is so that fullscreen mode doesn't have issues when it is launched.

    However, when it sits as part of the page, doodads such as the facebook chat panel appear underneath the game (GUI elements from facebook imho should appear on-top) any idea how the draw order for the actual HTML page can be corrected or is this impossible?
     
  8. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    At the moment, it is impossible. That's just how the Unity plugin is.

    However, there are some tricks, like using CSS to hide the DIV that the game is in when the Story Publish invite pops up.
     
  9. mehware

    mehware

    Joined:
    Nov 19, 2007
    Posts:
    739
    Man I started this thread a while ago... hehe..

    I am using Dimerocker for our newest facebook game Letter Slide.

    I recommend checking out DimeRocker @ dimerocker.com

    and our facebook game using it at http://apps.facebook.com/letterslide/ !

    Go Unity
    Go Facebook
    Go Unity + Facebook

    - Matt
     
  10. arbbot

    arbbot

    Joined:
    May 2, 2010
    Posts:
    74
    "Don't let the Mysterious Invaders conquer the universe! Destroy as many as you can using a wide range of power ups and mighty weapons to stop them. Use your navigation and fighting skills to stop the invasion!"

    Hi all,

    I wanted to share our newest game called "Mystery Invaders" that we released on Facebook a couple of weeks ago.

    The game is a remake of the classic Space Invaders, but we implemented a cool and different camera angle/perspective twist and changed the gameplay a little to make it more fun and relevant.

    We have a nice set of high polished 3D models, a wide range of power ups and mighty weapons, and a lot of levels to test your skills and compete to make it to the top ten high scores.

    The game was produced by MysteryD and released on Facebook using DimeRocker's social publishing platform.

    I was responsible for the game design, game direction, particle effects, integration and overall development of the game.

    Cheers!
    -arbbot
     

    Attached Files:

  11. arbbot

    arbbot

    Joined:
    May 2, 2010
    Posts:
    74
    Hi all,

    I have been reading a lot of posts and information about Facebook + Unity3D integration and I wanted to share my thoughts and a little sample to help the community bit.

    I think that this topic gets more confusing because there are different types of Facebook integration depending on what you want to achieve. Here's my take on different Facebook integration approaches:

    Web Basic Integration
    This is basically just embedding your hosted Unity3D web player into a Facebook canvas. This type of integration is the most simple of all because is basically just embedding your Unity3D web player into a Facebook page so people can play it right there. For this you will need to have your Unity3D web player already hosted and running somewhere with public access. The steps are super simple:
    1- Go to Facebook Developers
    2- Setup a new application
    3- Fill the Canvas Page text field with your desired app name
    4- Fill the Canvas URL text field with the URL of your unity web player

    Once you do that, you are done and you app will be already running in Facebook.

    Desktop Basic Integration
    With desktop applications it gets more tricky because Facebook Oauth 2.0 protocol forces you to redirect the user to Facebook to allow access to your application, and then you need to get the response and request the authentication content. This process is more advanced and the experience is kind of broken since the user has to leave the unity app to grant access using the Browser.

    Alternatively you can do just a basic integration, which is retrieving public Facebook information based on the Facebook username. For this you don't need to implement the authentication, and it's just calling Facebook public API services and render the results. This is not actually a real integration, but it will enable you to retrieve and render some basic Facebook information in your unity app without a lot of work.

    I have created a very simple app with only one script that requests the user for the Facebook username, and then uses it to retrieve the user's profile picture and render it as a Texture on a GameObject. This is just the basic stuff to get you started, but is well documented and very simple so it should help you get started. You can get the sample here.

    Facebook Advanced Integration - Web and Desktop
    This is the real thing. For web players it will be easier and the experience will be better cause the user will be already using a browser, and you can use JavaScript functions in the web player HTML (check the Unity docs) page to get manage the authentication of the app easily and pass the required information back to unity without issues. There are several third party solutions and I can recommend DimeRocker which is the platform we have been using for Mystery Invaders.

    If you are deploying your application using the Web Player, you need to basically use JavaScript and the Unity WWW class to authenticate and then connect to the Facebook Graph API to get and post the information you need.

    For desktop application the difference will reside on the Authentication process, which you will need to bridge between a web page and the desktop application. I'll be working on samples about this topic and hopefully posting something back to the community to help others get on track.
     

    Attached Files:

  12. keely

    keely

    Joined:
    Sep 9, 2010
    Posts:
    967
    Sorf of an offtopic, but does Facebook allow you to do your own "Available on the Appstore"-advertising within the game?
     
  13. Gerkor

    Gerkor

    Joined:
    Apr 13, 2010
    Posts:
    14
    Awesome arbbot, really useful!!
     
  14. grahnz

    grahnz

    Joined:
    Dec 1, 2010
    Posts:
    12
  15. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Hmm well I'm trying the most simple method (4- Fill the Canvas URL text field with the URL of your unity web player
    ) but its not working. The canvas url only lets me point to a directory and as my main.unity3d file is stored on amazon servers I point to them but I get access denied. Even though the file is set to read for everyone??

    Do I need to first put the unity.3d file INTO a html page and then link to that instead of directrly to a .unity3d file?

    Why isn't this easy?
     
  16. thakur.ravi26

    thakur.ravi26

    Joined:
    Nov 21, 2010
    Posts:
    1
  17. Pradeep-Patel

    Pradeep-Patel

    Joined:
    Mar 31, 2011
    Posts:
    96
    i can't download it wat problem
     
  18. LionTR

    LionTR

    Joined:
    Mar 26, 2010
    Posts:
    33
    Does anyone have a solution for this? I'm stuck at the same point, except I have uploaded my webplayer App to our server, and the www.<address>/AppName.html page is working properly. How can I embed this in a facebook App?
     
  19. jmpp

    jmpp

    Joined:
    Jun 1, 2010
    Posts:
    93
    You guys have to keep in mind that what Facebook displays in a canvas or tab is basically just a web page, however simple or complex it may be. That web page may or may not integrate with Facebook functionality through any of its SDK's, but other than that it's just PHP/HTML/CSS/JavaScript/etc content that's pulled into an iFrame.

    I recommend you guys first try to get your HTML-integrating-your-Unity-content going on your local development server (e.g. "localhost") and only then try to display that in a Facebook canvas and/or tab. If it works locally and you're not integrating with Facebook functionality, I don't see why it wouldn't work as an FB app if it is configured correctly in the Applications dashboard.

    For the latter, the following couple of pointers may help you:

    1) If you're configuring a "canvas" app, have the URLs point explicitly at a directory or file, e.g.:

    http://whatever.com/path/index.html, or
    http://whatever.com/path/,
    but not http://whatever.com/path, i.e. no trailing slash (if I'm not mistaken, FB will explicitly complain about this).

    The PHP/HTML/whatever that serves as index for that directory is presumably what loads your Unity content, or a portal to that of some kind (like I said, it's just a web page of arbitrary complexity).

    2) If you're configuring a "tab" app, have the URLs point all the way down to the file that's going to server as the entry point to your app, e.g.:

    http://whatever.com/path/index.php, or
    http://whatever.com/path/someOtherFile.php, or
    http://whatever.com/path/someOtherFile.py, etc
    but not http://whatever.com/path/
    nor http://whatever.com/path

    Because in the latter two cases you will not receive some information that Facebook posts to your app upon load and that will most surely prove valuable later on. Trust me on this last tip, it took me a *while* to figure it out! Facebook bug, undocumented feature... whatever, but that's how it works. Moreover, a URL of the form "http://whatever.com/path" (i.e. no trailing slash) will most probably fail for the same reasons as in the canvas configuration.

    So, once all that is covered and you have your content successfully loading in a Facebook iFrame, you may start configuring your page to actually start integrating with Facebook and leveraging its functionality... but first thing's first and I highly recommend a baby-steps approach to solving all the problems you're going to encounter while attempting deep Unity3D <-> Facebook integration rich user experience. Trust me, once I realized this I started making great headway with my JavaScript-based solution that took me months to conceive and is now allowing me to almost arbitrarily interact with Facebook (back forth) from *within* my Unity3D content and my web pages.

    HTH!
     
  20. murthyveera

    murthyveera

    Joined:
    Sep 18, 2012
    Posts:
    9
    Thank you so much please send me a sample project for web player integration with Facebook i am new to Facebook game integration please don't forget to send my mail id is vrams1988@gmail.com or snvsit44@gmail.com thanks and regards murthy veera
     
  21. murthyveera

    murthyveera

    Joined:
    Sep 18, 2012
    Posts:
    9
    hi guys send me the sample project for the flow its great help for me....
     
    Last edited: Oct 1, 2012
  22. Tochas

    Tochas

    Joined:
    Nov 24, 2012
    Posts:
    17
    @keely
    have you found the answer for this? I'm planing to develop a mini game to promote a full iPhone game and this could come in handy
     
  23. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Hey Fellas....
    This thread is excellent...
    I have been playing around with integrating into Facebook too...
    And, I believe that I have had really good success... :)

    I created a new Business FB page and figured out how to create custom tabs.
    Then I changed the tab pics and added html text into the tab page where my Unity projects launch...
    The biggest problem i have run into though has been that FB seems to insist on secure hosted domains...
    Such as, http:// does not work and FB needs https://
    That has driven me crazy....
    But, I found a real easy work around....

    I have not yet figured out how to get a full fledged App loaded and running...
    But, running a Unity game through a Custom tab is now easy...
    If anyone has interest, I can create a tutorial about how I pulled this off....

    Here, check out my FB page and have a look at my three custom tabs....
    Then let me know if it is worth anything and I will try helping more....

    Here is the FB address.....
    https://www.facebook.com/pages/TerraSame/429303540464520

    And BTW, the projects are all linked and are also what I call "3d Dynamic" websites...
    Let me know.....
    Thanks
     
  24. colpolstudios

    colpolstudios

    Joined:
    Nov 2, 2011
    Posts:
    150
    @TerraSame1 would you please create a tutorial about how I pulled this off.

    Excellent facebook page.

    Idealy I would like to the same as you have done but with my web player wip project.

    link: https://dl.dropboxusercontent.com/u/150707256/untiy web player build/WebPlayer.html
     
  25. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Hey colpolstudios.....

    Over the next couple a weeks I will attempt to create a decent tutorial about how I got my projects in my FB page with tabs...

    (I just launched a brand new revised web site yesterday so please let me know what you think and how the games run....)

    My main web site... www.terrasame.com
    Facebook Page... https://www.facebook.com/pages/TerraSame/429303540464520?ref=hl
    LinkdIn Company Products Page... http://www.linkedin.com/company/terrasame/products?trk=top_nav_products

    But till then here are the basics...

    The first thing you need to do is create a "Business Facebook Page" or a "Company LinkedIn Page".
    (These concepts WILL NOT work in regular pages...)
    After that you need to add tabs and give them pics and link urls...

    Here is the page for adding tabs... You can add a lot of tabs.... (This page is really important and is hard to find, so I am glad I saved it in my fav's)
    https://www.facebook.com/notes/stat...fbml-tabs-to-static-html-tabs/328428420564585

    After adding tabs you can paste your web site/page code into the admin page of the facebook page...
    Check out all that and in the mean time I will start creating a full tutorial... No promises when it will be done... I'm pretty busy right now...
    Remember all this only works inside a "Company FB Page"
    Let me know how it goes....
    I will try helping all I can......
     
  26. colpolstudios

    colpolstudios

    Joined:
    Nov 2, 2011
    Posts:
    150
    With the very kind help of TerraSame1, I have been able to add custom tags to my face book page.

    https://www.facebook.com/#!/pages/Colpolstudios/212712528855685?fref=ts

    I changed the html static icon which btw has to be 111 x 74 pixels with a limit of 5mb to one I created myself.

    You simply click on the tab to go to the new canvas page and then you can click on the image to load the unity files all using drop box :).

    As I am not a html coder I used http://www.html.am/html-editors/online-html-editor.cfm, once you are happy with your code you can copy and paste this code straight into the static code on the face book side of things.

    Only one issue that I found was the need to select "new blank window" as the target window for the link, if you do not use this you cannot close the web player.

    I also found if helpful to have word open with the links to the image file and the location of the web player file.

    Thank you so much TerraSame1 for all of your very kind help
     
  27. TerraSame1

    TerraSame1

    Joined:
    Nov 12, 2010
    Posts:
    151
    Colpolstudios...
    Done deal..... Great... Much more to learn and accomplish.... You are on your way... :)
    I played your game.... It's not too bad ....
    The car is nice...
    The map on the sign needs to be bigger and lower... at eye level....
    I noticed that the controller was kinda sticky on the ground and I got stuck twicew while going around the lake... ?
    It would be cool if I could click on the pic and a browser would launch taking me to the site I checked out...
    After checking out the site and walking around in your game... I think you did a pretty good job of making the lake the same shape... cool...
    Could use bird sounds and birds flying around... And... fish jumping... Trout like in the web site... Big "Rainbows"... :)
    Here is a link to the site I checked out....
    http://www.fishinginireland.info/trout/southwest/rainbows/caum.htm
    Glad I could help a little....
    Good work and keep going....
    What's next?
    :)

    Edit,,,,________________________________________
    By the way....
    When I first launched your FB link I was not logged into FB and I got a bad error from Drop Box...
    After I logged into FB, it launched perfectly...
    I think Drop Box is not the best choice to house your files.... But it works ok if the user is logged in...
    You might want to log out of FB, clear your cookies and history and try your link to see the error....
     
    Last edited: Jun 7, 2013