# Connect FMOD to Unity Game Error

**URL:** https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126
**Category:** Unity
**Created:** [October 30, 2015, 11:44am UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126 "2015-10-30T11:44:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![albertocarlassare](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@albertocarlassare](https://qa.fmod.com/u/albertocarlassare)
#### Post date: [October 30, 2015, 11:44am UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126/1 "2015-10-30T11:44:44Z")

</div>

‪#‎liveupdate‬ ‪#‎unity‬

Hi! I can’t get FMOD (1.07) synced to my Unity (5.2.2.1f) Game.  
I do the following:

1. I add ‪#‎define‬ LIVE\_UPDATE at the beginning of FMOD\_StudioSystem script

2. In FMOD: I save the project, build banks and export GUIDS

3. In Unity: I Import the banks (or Refresh Event List). Save the project and Save Scene. Play the game (the scene is empty).

4 In FMOD: File/Connect to game - IP Address: localhost - Push Connect

FMOD give me back this message:

"Studio was unable connect to “localhost” as a connection error occurred: “Socket Error”

Please check that the IP address is correct, the game is running and live update is enabled"

WHY?? How can I get it working?

---

<div class="post-metadata">

### Author: ![mightypants](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@mightypants](https://qa.fmod.com/u/mightypants)
#### Post date: [October 30, 2015, 1:48pm UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126/2 "2015-10-30T13:48:57Z")

</div>

Check out this post:  
[http://www.fmod.org/questions/question/fmod-studio-integration-liveupdate-cannot-connect-with-unity-5-beta/](http://www.fmod.org/questions/question/fmod-studio-integration-liveupdate-cannot-connect-with-unity-5-beta/)

---

<div class="post-metadata">

### Author: ![albertocarlassare](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@albertocarlassare](https://qa.fmod.com/u/albertocarlassare)
#### Post date: [October 30, 2015, 4:42pm UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126/3 "2015-10-30T16:42:40Z")

</div>

I’ve seen it, but I don’t have no FMOD\_StudioSystem.cpp script after importing fmodstudio10701.unitypackage into unity. There is a FMOD\_StudioSystem.cs . Is that the same?

The post you suggested me speak about line 258. My line 258 of FMOD\_StudioSystem.cs has the following code:

(first line 257)  
DontDestroyOnLoad(gameObject);  
[this is my line n258]  
FMOD.Studio.UnityUtil.Log(“FMOD\_StudioSystem: System\_Create”);  
ERRCHECK(FMOD.Studio.System.create(out system));

```
    FMOD.Studio.INITFLAGS flags = FMOD.Studio.INITFLAGS.NORMAL;
	
	FMOD.System sys;
	ERRCHECK(system.getLowLevelSystem(out sys));
	FMOD.ADVANCEDSETTINGS advancedSettings = new FMOD.ADVANCEDSETTINGS();
	advancedSettings.randomSeed = (uint) DateTime.Now.Ticks;

```

(end of code)

If I put there that code console give ma back an error. What to do? Is there the script already modified?

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [October 30, 2015, 11:48pm UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126/4 "2015-10-30T23:48:06Z")

</div>

The correct define is FMOD\_LIVEUPDATE

Read the documentation here: [http://www.fmod.org/documentation/#content/generated/engine\_unity/configuration.html](http://www.fmod.org/documentation/#content/generated/engine_unity/configuration.html)

---

<div class="post-metadata">

### Author: ![albertocarlassare](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@albertocarlassare](https://qa.fmod.com/u/albertocarlassare)
#### Post date: [October 30, 2015, 11:51pm UTC](https://qa.fmod.com/t/connect-fmod-to-unity-game-error/12126/5 "2015-10-30T23:51:43Z")

</div>

Thanks Nicholas,

that was the issue. just adding #define FMOD\_LIVEUPDATE in FMOD\_StudioSystem.cs script FMOD Connect straight at localhost:9265

Such a simple mistake!
