public void Initialize() { _contexts.game.isPlayer = true; GameEntity playerEntity = _contexts.game.playerEntity; Vector3 position = new Vector3(0, 1.5f, 0); Transform tf = GameObject.Instantiate(_playerTemplate, position, Quaternion.identity); playerEntity.AddView(tf.gameObject); tf.gameObject.Link(playerEntity); CharacterController controller = tf.GetComponent <CharacterController>(); Transform camera = tf.Find("Main Camera"); Transform groundCheck = tf.Find("GroundCheck"); playerEntity.AddPlayerLook(camera); playerEntity.AddAffectedByGravity(controller, groundCheck, 6); playerEntity.AddPosition(position); playerEntity.AddSpeed(12f); playerEntity.AddVelocity(Vector3.zero); playerEntity.AddYaw(0); playerEntity.AddCameraPitch(0); playerEntity.shouldUpdateView = true; playerEntity.shouldUpdateLook = true; }