Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

MonoBehaviour.OnServerInitialized()

Switch to Manual

Description

Called on the server whenever a Network.InitializeServer was invoked and has completed.

	function OnServerInitialized() {
		Debug.Log("Server initialized and ready");
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void OnServerInitialized() {
        Debug.Log("Server initialized and ready");
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def OnServerInitialized() as void:
		Debug.Log('Server initialized and ready')