{"id":325,"date":"2016-10-31T23:07:21","date_gmt":"2016-10-31T22:07:21","guid":{"rendered":"http:\/\/www.bellingo.de\/blog\/?p=325"},"modified":"2016-10-31T23:09:16","modified_gmt":"2016-10-31T22:09:16","slug":"unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events","status":"publish","type":"post","link":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/","title":{"rendered":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events"},"content":{"rendered":"<p>Unitys Multiplayer-Netzwerkschicht\u00a0UNet ist einfach zu verwenden und eine gute L\u00f6sung f\u00fcr Projekte ohne besondere Anforderungen in dieser Hinsicht. Allerdings finde ich in meinem mittlerweile zweiten Projekt mit UNet immer noch neue Fallstricke die mit zeitweise den Spa\u00df am Programmieren rauben. Dieses Mal wunderte ich mich \u00fcber einige SyncVars, die nicht korrekt synchronisiert wurden, bis ich herausfand, dass mein Problem gar nichts mit ihnen zu tun hatte. Vielmehr entdeckte ich dass die OnStartClient-Methode der NetworkBehaviour-Klasse nicht immer in der gleichen Reihenfolge mit anderen Callbacks wie Awake und Start ausgef\u00fchrt wird.<\/p>\n<p><!--more--><\/p>\n<p>Diesen Artikel habe ich bisher nur auf <a href=\"https:\/\/www.bellingo.de\/blog\/unet-pitfalls-onstartclient-execution-order\/\" target=\"_blank\">Englisch<\/a> verfasst. Solltest Du eine deutsche \u00dcbersetzung ben\u00f6tigen so schicke mir bitte eine <a href=\"mailto:blog@bellingo.de\" target=\"_blank\">Nachricht<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unitys Multiplayer-Netzwerkschicht\u00a0UNet ist einfach zu verwenden und eine gute L\u00f6sung f\u00fcr Projekte ohne besondere Anforderungen in dieser Hinsicht. Allerdings finde ich in meinem mittlerweile zweiten Projekt mit UNet immer noch neue Fallstricke die mit zeitweise den Spa\u00df am Programmieren rauben. Dieses Mal wunderte ich mich \u00fcber einige SyncVars, die nicht korrekt synchronisiert wurden, bis ich &hellip; <a href=\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\" class=\"more-link\"><span class=\"screen-reader-text\">UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":318,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,146,30],"tags":[148,150,152,157,154,32],"class_list":["post-325","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spieleentwicklung","category-unet","category-unity","tag-development-build-de","tag-networkbehaviour-de","tag-onstartclient-de","tag-syncvar","tag-unet-de","tag-unity"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog<\/title>\n<meta name=\"description\" content=\"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog\" \/>\n<meta property=\"og:description\" content=\"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\" \/>\n<meta property=\"og:site_name\" content=\"Games:Tech:Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-31T22:07:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-31T22:09:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png\" \/>\n\t<meta property=\"og:image:width\" content=\"893\" \/>\n\t<meta property=\"og:image:height\" content=\"285\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ingo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ingo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\"},\"author\":{\"name\":\"Ingo\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9\"},\"headline\":\"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events\",\"datePublished\":\"2016-10-31T22:07:21+00:00\",\"dateModified\":\"2016-10-31T22:09:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\"},\"wordCount\":120,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9\"},\"image\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png\",\"keywords\":[\"Development Build\",\"NetworkBehaviour\",\"OnStartClient\",\"SyncVar\",\"UNet\",\"Unity\"],\"articleSection\":[\"Spieleentwicklung\",\"UNet\",\"Unity\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\",\"url\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\",\"name\":\"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png\",\"datePublished\":\"2016-10-31T22:07:21+00:00\",\"dateModified\":\"2016-10-31T22:09:16+00:00\",\"description\":\"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage\",\"url\":\"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png\",\"contentUrl\":\"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png\",\"width\":893,\"height\":285,\"caption\":\"Lobby view before starting the game.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.bellingo.de\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/#website\",\"url\":\"https:\/\/www.bellingo.de\/blog\/\",\"name\":\"Games:Tech:Blog\",\"description\":\"A Blog about Games, Technology in Games, and Technology in General\",\"publisher\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.bellingo.de\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9\",\"name\":\"Ingo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93a4b9881ee1983f4fafc7e996ce82a42c3a1540c18f7417809c08a19658f167?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93a4b9881ee1983f4fafc7e996ce82a42c3a1540c18f7417809c08a19658f167?s=96&d=mm&r=g\",\"caption\":\"Ingo\"},\"logo\":{\"@id\":\"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.bellingo.de\/blog\/author\/ingo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog","description":"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/","og_locale":"de_DE","og_type":"article","og_title":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog","og_description":"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.","og_url":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/","og_site_name":"Games:Tech:Blog","article_published_time":"2016-10-31T22:07:21+00:00","article_modified_time":"2016-10-31T22:09:16+00:00","og_image":[{"width":893,"height":285,"url":"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png","type":"image\/png"}],"author":"Ingo","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Ingo","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#article","isPartOf":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/"},"author":{"name":"Ingo","@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9"},"headline":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events","datePublished":"2016-10-31T22:07:21+00:00","dateModified":"2016-10-31T22:09:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/"},"wordCount":120,"commentCount":0,"publisher":{"@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9"},"image":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png","keywords":["Development Build","NetworkBehaviour","OnStartClient","SyncVar","UNet","Unity"],"articleSection":["Spieleentwicklung","UNet","Unity"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/","url":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/","name":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events - Games:Tech:Blog","isPartOf":{"@id":"https:\/\/www.bellingo.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage"},"image":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png","datePublished":"2016-10-31T22:07:21+00:00","dateModified":"2016-10-31T22:09:16+00:00","description":"Die Ausf\u00fchrungsreihenfolge von Awake, OnstartClient und Start von NetworkBehaviours ist nicht immer deterministisch. Development Builds verhindern Probleme.","breadcrumb":{"@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#primaryimage","url":"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png","contentUrl":"https:\/\/www.bellingo.de\/blog\/wp-content\/uploads\/2016\/10\/LobbyExample-1-e1477687813955.png","width":893,"height":285,"caption":"Lobby view before starting the game."},{"@type":"BreadcrumbList","@id":"https:\/\/www.bellingo.de\/blog\/unet-fallstricke-ausfuehrungsreihenfolge-von-onstartclient-events\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.bellingo.de\/blog\/"},{"@type":"ListItem","position":2,"name":"UNet-Fallstricke: Ausf\u00fchrungsreihenfolge von OnStartClient-Events"}]},{"@type":"WebSite","@id":"https:\/\/www.bellingo.de\/blog\/#website","url":"https:\/\/www.bellingo.de\/blog\/","name":"Games:Tech:Blog","description":"A Blog about Games, Technology in Games, and Technology in General","publisher":{"@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bellingo.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/82498f8ac21d11f5948cab6d0a9807e9","name":"Ingo","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/93a4b9881ee1983f4fafc7e996ce82a42c3a1540c18f7417809c08a19658f167?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93a4b9881ee1983f4fafc7e996ce82a42c3a1540c18f7417809c08a19658f167?s=96&d=mm&r=g","caption":"Ingo"},"logo":{"@id":"https:\/\/www.bellingo.de\/blog\/#\/schema\/person\/image\/"},"url":"https:\/\/www.bellingo.de\/blog\/author\/ingo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":2,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":327,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/posts\/325\/revisions\/327"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/media\/318"}],"wp:attachment":[{"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bellingo.de\/blog\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}