# Lag / latency when moving a Gameobject on build but not on editor.

**URL:** <https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587>\
**Category:** Help\
**Created:** [September 16, 2024, 10:14pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587 "2024-09-16T22:14:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 16, 2024, 10:14pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/1 "2024-09-16T22:14:20Z")

</div>

Hi I’m using a world on the coherence dashboard to test movement and im getting huge latency when testing via a build. This happens between builds (ie two builds connected to the coherence world on the same computer both see lag from the other connected player).

But weirdly enough an editor version connecting to the world will produce extremely smooth replicated movement on other builds that are connected.

Any ideas on what is causing this?

Many thanks.

---

<div class="post-metadata">

**Author:** ![cary](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/cary/32/37_2.png) [@cary](https://community.coherence.io/u/cary)\
**Post date:** [September 16, 2024, 10:36pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/2 "2024-09-16T22:36:42Z")

</div>

Hey, make sure “Run in Background” is enabled in the player settings.  
 ![Screenshot 2024-09-16 at 3.35.29 PM](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/0e74cfcb1bfe88b28979b378b495e4005483621b.png)

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 16, 2024, 10:41pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/3 "2024-09-16T22:41:45Z")

</div>

Ok will do. Thanks 👍

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 17, 2024, 1:41am UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/4 "2024-09-17T01:41:28Z")

</div>

Hi, it appears I had run in background enabled already. I tried rebuilding to make sure the build had run in background enabled but still having the same issue.

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [September 17, 2024, 6:38am UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/5 "2024-09-17T06:38:10Z")

</div>

Hmm. Are these WebGL builds, or standalone?  
In WebGL, performance decreases incredibly when the build goes in a background tab.

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 17, 2024, 6:24pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/6 "2024-09-17T18:24:02Z")

</div>

Hi, no its just a regular windows build on my local machine, using unity 6.

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 20, 2024, 2:05am UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/7 "2024-09-20T02:05:21Z")

</div>

I have a video now to show the differences.

If you need any more information let me know.

Many thanks.

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 20, 2024, 2:33am UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/8 "2024-09-20T02:33:50Z")

</div>

Ok this definitely **is** being caused by run in background not being enabled, but it is definitely selected in the project settings so must be a **unity bug** , not sure if its just unity 6 preview or if anyone else has experienced this in other versions.

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [September 20, 2024, 11:46am UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/9 "2024-09-20T11:46:14Z")

</div>

Hmm hard to say… can you share the movement code?  
And also the configuration of the `CoherenceSync`?

---

<div class="post-metadata">

**Author:** ![AceGames](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/acegames/32/542_2.png) [@AceGames](https://community.coherence.io/u/AceGames)\
**Post date:** [September 22, 2024, 7:36pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/10 "2024-09-22T19:36:23Z")

</div>

Hi Ciro, sorry i could not get back to you sooner on this but the good news is this not a coherence issue at all, but appears to be a performance / framerate issue when the window looses focus specifically on **builds** (editor performance is unaffected by this).which initially i thought was latency, but it affects builds not even using coherence as well.

It may be related to this forum issue here [Standalone Build extremely slow when run in Background - Unity Engine - Unity Discussions](https://discussions.unity.com/t/standalone-build-extremely-slow-when-run-in-background/783150).

luckily as editor performance is unaffected I should be able to use ParrelSync for testing.

Cheers 👍

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [September 26, 2024, 2:07pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/11 "2024-09-26T14:07:18Z")

</div>

Great to hear, and also thanks a lot for taking the time to write it back! I’ll mark your reply as a Solution then, for now.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/b3aa79eb9519fac7aad7eba18f15a1e8ce60f6e2.png) [@system](https://community.coherence.io/u/system)\
**Post date:** [December 25, 2024, 2:08pm UTC](https://community.coherence.io/t/lag-latency-when-moving-a-gameobject-on-build-but-not-on-editor/587/12 "2024-12-25T14:08:00Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
