# What does this error mean? (588047)

**URL:** https://discussions.unity.com/t/what-does-this-error-mean-588047/588047
**Category:** Scripting
**Tags:** Scripting
**Created:** [July 5, 2015, 5:00pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047 "2015-07-05T17:00:54Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![cruising](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/cruising/32/321126_2.png) [@cruising](https://discussions.unity.com/u/cruising)
#### Post date: [July 5, 2015, 5:00pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/1 "2015-07-05T17:00:54Z")

</div>

Hello!

im getting this error, what does it mean?

```csharp
GetLocalizedString can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

```

It dont tell what script making the error, but its clearly my script for loading scenes with buttons.

---

<div class="post-metadata">

### Author: ![SomeGuy22](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/someguy22/32/480372_2.png) [@SomeGuy22](https://discussions.unity.com/u/SomeGuy22)
#### Post date: [July 5, 2015, 7:34pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/2 "2015-07-05T19:34:55Z")

</div>

The comment in this question might help:

> **[Application.LoadLevel ArgumentException](https://discussions.unity.com/questions/995185/applicationloadlevel-argumentexception.html)**
>
> Hi, I am loading a level from a scene in my main menue with Application.LoadLevel(name); When the new scene is loaded, I get: ArgumentException: GetLocalizedString can only be called from the main thread. Constructors and field initializers...

Seems like a strange error, could be many things causing it.

---

<div class="post-metadata">

### Author: ![Kiwasi](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kiwasi/32/351502_2.png) [@Kiwasi](https://discussions.unity.com/u/Kiwasi)
#### Post date: [July 5, 2015, 7:45pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/3 "2015-07-05T19:45:23Z")

</div>

Often you get this when attempting to call a function at the definition stage. If you are doing this, try moving it to Awake instead.

---

<div class="post-metadata">

### Author: ![Shadamer](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Shadamer](https://discussions.unity.com/u/Shadamer)
#### Post date: [November 24, 2015, 2:11am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/4 "2015-11-24T02:11:25Z")

</div>

I got this error a couple of times after upgrading my project to Unity 5. Turns out I had trees I made from the tree creator in my scene. Once I removed them, the error went away.

---

<div class="post-metadata">

### Author: ![Hvost239](https://avatars.discourse-cdn.com/v4/letter/h/b19c9b/32.png) [@Hvost239](https://discussions.unity.com/u/Hvost239)
#### Post date: [December 1, 2015, 2:31pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/5 "2015-12-01T14:31:15Z")

</div>

> [@Shadamer](#):
>
> I got this error a couple of times after upgrading my project to Unity 5. Turns out I had trees I made from the tree creator in my scene. Once I removed them, the error went away.

I have same solution

---

<div class="post-metadata">

### Author: ![Kiwasi](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kiwasi/32/351502_2.png) [@Kiwasi](https://discussions.unity.com/u/Kiwasi)
#### Post date: [December 7, 2015, 8:30am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/6 "2015-12-07T08:30:47Z")

</div>

> [@""](#):
>
> WTF ? Is this really the OFFICIAL statement to destroy the whole level art in a late state of development to fix this F\*\*\*\*\*\*\*\* engine bug? Are you kidding me Unity Support ?

???

No official has commented on this thread. Do you have an official comment somewhere else?

Normally the stance from Unity developers is to not change engine versions in late stage development.

---

<div class="post-metadata">

### Author: ![jister](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jister/32/380649_2.png) [@jister](https://discussions.unity.com/u/jister)
#### Post date: [December 7, 2015, 1:11pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/7 "2015-12-07T13:11:26Z")

</div>

maybe this guy’s [solution](http://answers.unity3d.com/questions/995185/applicationloadlevel-argumentexception.html) helps

---

<div class="post-metadata">

### Author: ![AshyB](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@AshyB](https://discussions.unity.com/u/AshyB)
#### Post date: [December 12, 2015, 11:33pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/8 "2015-12-12T23:33:12Z")

</div>

Old reply, but I just had this problem. For me its caused by trees. I grabbed everything in the scene, put it under an empty game object, made a prefab from it. Deleted the prefab. Errors gone.

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [December 15, 2015, 10:29pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/9 "2015-12-15T22:29:16Z")

</div>

Same here. I’ve been making as much noise about it as I can for months and months without any reply from anyone at Unity. Is this ever going to be fixed?

```auto
ArgumentException: GetLocalizedString can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
TreeEditor.TreeGroupRoot..cctor ()
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for TreeEditor.TreeGroupRoot

```

I tried the prefab trick and it worked, but it’d be a lot better if this issue just never came up again.

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [December 15, 2015, 10:40pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/10 "2015-12-15T22:40:26Z")

</div>

Actually no, it didn’t work. The first time it kind of did (my original terrain was still there though, just unchecked) but the second time (deleting the original terrain) it caused a bunch of other things to break in addition to the original errors showing up again. Something to do with it being a prefab I guess.

So… No. The prefab trick does not work.

---

<div class="post-metadata">

### Author: ![jister](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/jister/32/380649_2.png) [@jister](https://discussions.unity.com/u/jister)
#### Post date: [December 16, 2015, 3:22pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/11 "2015-12-16T15:22:10Z")

</div>

i think you were suppose to delete the prefab not the original 🙂

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [December 17, 2015, 2:16am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/12 "2015-12-17T02:16:29Z")

</div>

Oh! 😄 I’ll try that, thanks. 🙂

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [December 17, 2015, 2:21am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/13 "2015-12-17T02:21:53Z")

</div>

Just tried it. It worked the first time I hit play, but after that the errors return, so nope, it didn’t really work or I’m still missing something.

It’s a pain because any time I change scenes in play mode it pauses Unity so you can see the errors. When it’s running in the Rift I turn off the mouse cursor which makes it a bit tricky to hit the play button.

---

<div class="post-metadata">

### Author: ![FlyAnvil](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@FlyAnvil](https://discussions.unity.com/u/FlyAnvil)
#### Post date: [January 11, 2016, 11:52am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/14 "2016-01-11T11:52:08Z")

</div>

TRY THIS:

> **[Loadlevel editor error -Tree editor?](https://discussions.unity.com/threads/loadlevel-editor-error-tree-editor.364404/)**
>
> ArgumentException: GetLocalizedString can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene. Don't use this function in the constructor or field initializers,...

---

<div class="post-metadata">

### Author: ![David-Berger](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/david-berger/32/44177_2.png) [@David-Berger](https://discussions.unity.com/u/David-Berger)
#### Post date: [January 28, 2016, 8:38pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/15 "2016-01-28T20:38:23Z")

</div>

Just to keep you updated, we have seen the problem and someone reported a very useful incident which we can use to reproduce the issue. We will work on a solution to the problem, in the meantime please try the workaround posted by @FlyAnvil and let us know in the thread of the workaround if it works for you or not as it might help to solve the issue when we know more about the behaviour. You can follow the report and outcome here: [Unity Issue Tracker - [SpeedTree] GetLocalizedString error messages when loading scene with trees](http://issuetracker.unity3d.com/issues/speedtree-getlocalizedstring-error-messages-when-loading-scene-with-trees)

---

<div class="post-metadata">

### Author: ![ev3d](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/ev3d/32/479259_2.png) [@ev3d](https://discussions.unity.com/u/ev3d)
#### Post date: [January 29, 2016, 3:26am UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/16 "2016-01-29T03:26:47Z")

</div>

FWIW, i was having the same issue…And this worked… I deleted the trees from the scene and re-added them (luckily there position was not important)… and after doing that, the error is gone.

Also, in case it matters, i went as far as deleting the trees and re adding them (useing the “edit trees” button in the terrain editor). I then repainted the trees on the terrain.

---

<div class="post-metadata">

### Author: ![daisySa](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/daisysa/32/611305_2.png) [@daisySa](https://discussions.unity.com/u/daisySa)
#### Post date: [January 31, 2016, 12:08pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/17 "2016-01-31T12:08:07Z")

</div>

@David-Berger The solution suggested by FlyAnvil didn’t work for me.

I just selected Edit Tree and Apply for each tree in the terrain; I didn’t try ev3d’s solution of deleting and repainting each tree, as I have too many in the scene to do that all again unless absolutely necessary.

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [January 31, 2016, 7:19pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/18 "2016-01-31T19:19:29Z")

</div>

Sorry, I’m missing something. Where are you clicking “edit tree” and “apply?” Are you clicking the tree prefabs in the project or is this something you’re doing in the scene hierarchy?

I’m using Terrain Composer which adds the trees to the terrain itself, so if this is something that has to be done directly on the trees in the Unity terrain editor, I’m not sure if I can solve the problem this way. If it’s just something I can fix by fiddling with the tree prefabs directly, that’d be great because I only have a few of them in my scenes. Wouldn’t take long at all to do.

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [January 31, 2016, 7:22pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/19 "2016-01-31T19:22:32Z")

</div>

Think I found it. Guess it doesn’t matter if I’m using Terrain Composer or not. The trees are there when I click the terrains in the hierarchy. However, when I click a tree and hit “edit trees” and then “edit tree” in the dropdown under that, I am not able to click “apply” on all of the trees. Some of them give the error “tree has already been selected as a prototype” as shown here. No idea what that means.

 ![2489868--171781--edit tree.jpg](https://europe1.discourse-cdn.com/unity/original/4X/5/8/3/5831fea25921202b03be425c2211089b468d5308.jpeg)

---

<div class="post-metadata">

### Author: ![Todd-Wasson](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Todd-Wasson](https://discussions.unity.com/u/Todd-Wasson)
#### Post date: [January 31, 2016, 7:35pm UTC](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047/20 "2016-01-31T19:35:33Z")

</div>

Ok, I hit “apply” on all the trees that didn’t give the error (some of those trees might not be in this scene, I seem to remember only using a few of them). It fixed it, but only for the first time that I pressed play. Once I stopped and ran it a second time, the errors returned.

So no, this has the same results as the original fix. Still broken for me.

[Next page](https://discussions.unity.com/t/what-does-this-error-mean-588047/588047.md?page=2)
