Search Issue Tracker
Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.
Postponed
Votes
43
Found in
5.6.0f3
Issue ID
902995
Regression
No
Awake of NetworkBehaviour is not called at launch in standalone build, but is in the Editor
In Editor, Awake and Start functions are called as follows: Awake in Networked object, Awake in local object, Start in local object, Start in Networked object
In Player, Awake and Start functions are called as follows: Awake in local object, Start in local object, Awake in networked object, start in Networked object
To reproduce:
1. Open the project, attached by tester
2. Open "test" scene if not open
3. Press Play
4. Create Host
4. Observe the console
5. Stop the game
6. Build and run a standalone
8. After it has launched, create Host and close the game
9. Go to {standaloneName}_Data folder and open output_log.txt file
10. Observe the order of outputs from Awake and Start methods
Expected: Awake and Start methods are called in the same order on MonoBehaviour and NetworkBehaviour objects no matter if it is in Editor or in standalone build
Actual: the execution order of Awake and Start methods in Editor are diferrent than in standalone build when using NetworkBehaviour
Reproduced on 5.4.5p1, 5.5.3p1, 5.6.0p2, 2017.1.0b1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Dragon Crashers] Build fails in U6
- [Dragon Crashers] 4 Shader error messages on import
- [Dragon Crashers] Readme text is white on light grey
- Cursor stays in front of the first character when entering text in the TextMeshPro field
- Searching in Hierarchy causes unwanted component calls
spidermancy612
May 03, 2019 14:16
Quick update for anyone who finds themselves here like I did. The issue is still persistent in Unity 2018 1.0f2.
Also to add to it. Awake/Start cannot run on any class inheriting from NetworkBehavior as well as will not run on any object with a network component as far as I can tell. To get around this you can create a separate GameObject without any networking on it, then attach a Monobehavior class to it, you can then run the awake/start methods there.
romikula
Mar 11, 2018 20:11
Confirming the issue, neither Awake, Start nor Enable are working when inheriting NetworkBehaviour :(
RikuTheFuffs
Feb 13, 2018 09:52
Is it possible that this bug is still active after one year? I'm using 5.5.5p1 where this issue doesn't seem to appear, but I'd really like to update to 5.6 and can't do that.
Chikari
Jan 02, 2018 19:51
Still a problem for 2017.3.
Kailric
Aug 28, 2017 15:39
I just noticed this issue as well in 2017 build. I have been using the Unity created LobbyManager Asset and the NetworkBehavior objects start as they should. But when I created my own means to start a match the Start and Awake functions no longer work in standalone.
quenchless
Jul 02, 2017 15:28
This is very severe please fix.
flinter
Jun 30, 2017 02:35
In my case I have screen with buttons like Start Server, Start Client and etc.
I made script from PHAEM (because just call broadcast doesn't work.
public class ForceAwake : MonoBehaviour
{
public MyNetworkManager manager;
private void Awake()
{
manager.gameObject.SetActive(true);
}
}
I see in the log that component Awaked.
But in my method NetworkManager.singleton is equal NULL
When I pressed button, (just UI Button) it works normally.
It is so bad issue :(((
andyasj
May 12, 2017 16:59
I have a working editor project but in build awake not called AT ALL for one NetworkBehavior.
phaem
May 12, 2017 08:34
I solved those issues using this script on parent objects:
public class ForceAwake : MonoBehaviour
{
private void Awake()
{
BroadcastMessage("ForcedAwake");
}
}
This way it works in standalone exactly as in editor.
ownself
May 10, 2017 03:24
This happens all the way from 5.4 to 5.6, still not fixed, I wonder how the developer not notice this...