Thank you for visiting → Compete For ← If you find anything useful leave me a comment and share. Interested in Arduino, C#, Unity3D, Game Creation, VB.NET, learning and most important of all Sharing!.
Close Notification
Open Notification

Unity3D Pass Data to Online PHP using C# Coroutine

Unity3D Pass Data to Online PHP using C# Coroutine

Its easy to send data to a Online PHP script from your Unity3D game. For this tutorial we are going to use a “Coroutine”. which are extremely handy. So what we are going to do is this

  1. Send data from the game to a PHP script.
  2. Using PHP write that data to a file name sent in that data.
  3. Confirm the data was written.

Ok before we get started we need to create our PHP file, so on your hosting create a new PHP file called “save_player_data.php”

In “save_player_data.php” paste this


  Ok we got the PHP sorted out now upload it to your hosting and lets start with Unity3D.  

    1. Firstly create an “New -> Empty Game Object”  and call it SaveToPHP.


  • Create a new C# script and call it Senddata.



  • Paste this C# script into Senddate.cs.





Now save and Drag Senddate.cs and drop onto the Senddata object you created.


Now press Play in Unity and check your hosting (in the same directory and your PHP script) and you should have a new text file called PlayerName.txt, that contains PlayerName,SomeData,



  1. khizar · January 5, 2014 Reply

    hey. you named incorrectly . otherwise good effort thanx

Leave a reply