java – JavaFx Event argument type mismatch when changing scenes

I’ve created a simple login form for an application I’m working on. When submitting the form and loading the next scene, everything works as expected except the following error being shown in the console:

Exception in thread “JavaFX Application Thread” java.lang.IllegalArgumentException: argument type mismatch

I’ve tried everything I can think of to get rid of this including solutions that worked for similar questions here(changing ActionEvent to Event), but nothing seems to work. I’d appreciate any help you guys may be able to give.


Here’s my LoginController:

package controller;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.stage.Stage;
import model.User;

import java.io.IOException;
import java.net.URL;
import java.time.ZoneId;
import java.util.ResourceBundle;

public class LoginController implements Initializable {

    Stage stage;
    Parent scene;

    @FXML
    private Label loginLbl, userIDLbl, passwordLbl, errorLbl, zoneLbl, zoneIDlbl;

    @FXML
    private PasswordField passwordField;

    @FXML
    private TextField userIDField;

    @FXML
    private Button submitBtn;

    @FXML
    private void onSubmit(ActionEvent event) throws IOException {
        String username = userIDField.getText();
        String password = passwordField.getText();

        if (User.authenticate(username, password)) {
            showAppointments(event);
        } else {
            userIDField.setText("");
            passwordField.setText("");
            errorLbl.setText("Error logging in. Check credentials and try again.");
            userIDField.requestFocus();
        }
    }

    private void showAppointments(ActionEvent event) throws IOException {
        stage = (Stage)((Button)event.getSource()).getScene().getWindow();
        scene = FXMLLoader.load(getClass().getResource("/view/appointments.fxml"));
        stage.setScene(new Scene(scene));
        stage.setTitle("Appointments");
        stage.centerOnScreen();
        stage.show();
    }

    @FXML
    void clearError(KeyEvent event) {
        errorLbl.setText("");
    }

    @Override
    public void initialize(URL url, ResourceBundle resourceBundle) {
        errorLbl.setText("");
        zoneLbl.setText(ZoneId.systemDefault().getId());
    }
}

Here’s the login.fxml:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="300.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.LoginController">
   <children>
      <VBox alignment="TOP_CENTER" prefHeight="400.0" prefWidth="400.0">
         <children>
            <Label fx:id="loginLbl" alignment="CENTER" text="Log In">
               <font>
                  <Font name="System Bold" size="36.0" />
               </font>
               <VBox.margin>
                  <Insets bottom="30.0" />
               </VBox.margin>
            </Label>
            <GridPane vgap="10.0">
              <columnConstraints>
                <ColumnConstraints halignment="RIGHT" hgrow="SOMETIMES" maxWidth="196.0" minWidth="10.0" prefWidth="134.0" />
                <ColumnConstraints hgrow="SOMETIMES" maxWidth="275.0" minWidth="10.0" prefWidth="266.0" />
              </columnConstraints>
              <rowConstraints>
                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
                <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
              </rowConstraints>
               <children>
                  <Label fx:id="userIDLbl" text="User ID">
                     <padding>
                        <Insets right="10.0" />
                     </padding>
                  </Label>
                  <Label fx:id="passwordLbl" text="Password" GridPane.rowIndex="1">
                     <padding>
                        <Insets right="10.0" />
                     </padding>
                  </Label>
                  <TextField fx:id="userIDField" onKeyPressed="#clearError" GridPane.columnIndex="1">
                     <GridPane.margin>
                        <Insets right="25.0" />
                     </GridPane.margin>
                  </TextField>
                  <PasswordField fx:id="passwordField" GridPane.columnIndex="1" GridPane.rowIndex="1">
                     <GridPane.margin>
                        <Insets right="25.0" />
                     </GridPane.margin>
                  </PasswordField>
               </children>
            </GridPane>
            <HBox alignment="CENTER_RIGHT" prefHeight="50.0" prefWidth="200.0">
               <children>
                  <Button fx:id="submitBtn" alignment="CENTER_RIGHT" contentDisplay="CENTER" mnemonicParsing="false" onAction="#onSubmit" text="Submit" />
               </children>
               <VBox.margin>
                  <Insets right="25.0" />
               </VBox.margin>
            </HBox>
            <Label fx:id="errorLbl" text="Label" textFill="#cd1c1c" />
            <HBox alignment="BOTTOM_LEFT" prefHeight="40.0" prefWidth="200.0">
               <children>
                  <Label fx:id="zoneIDLbl" text="Zone ID: " />
                  <Label fx:id="zoneLbl" text="Label" />
               </children>
               <VBox.margin>
                  <Insets left="10.0" />
               </VBox.margin>
            </HBox>
         </children>
         <padding>
            <Insets top="25.0" />
         </padding>
      </VBox>
   </children>
</AnchorPane>

And here’s the exception:

Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: argument type mismatch
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
    at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.controls/javafx.scene.control.Tab$1.invalidated(Tab.java:215)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:110)
    at javafx.base/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
    at javafx.controls/javafx.scene.control.Tab.setSelected(Tab.java:189)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:741)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.select(TabPane.java:754)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.findNearestAvailableTab(TabPane.java:810)
    at javafx.controls/javafx.scene.control.TabPane$TabPaneSelectionModel.lambda$new$0(TabPane.java:710)
    at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
    at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
    at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:239)
    at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
    at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
    at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:211)
    at javafx.base/javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:162)
    at java.base/java.util.AbstractList.add(AbstractList.java:111)
    at javafx.fxml/javafx.fxml.FXMLLoader$Element.add(FXMLLoader.java:177)
    at javafx.fxml/javafx.fxml.FXMLLoader$PropertyElement.add(FXMLLoader.java:1417)
    at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:798)
    at javafx.fxml/javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2924)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2639)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3323)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3280)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3249)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3222)
    at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3199)
    at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3192)
    at controller.LoginController.showAppointments(LoginController.java:56)
    at controller.LoginController.onSubmit(LoginController.java:45)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
    at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
    at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
    at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8889)
    at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
    at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
    at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
    at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
    at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
    at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
    at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
    at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
    at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
    at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)

Any ideas what may be causing this?

flutter – Is there a way i can embed virtual reality scenes using arcore_flutter_plugin

Just wanted to inquire is there any way i can embed VIRTUAL REALITY using arcore_flutter_plugin, One can do this using arkit_plugin checkout this video https://www.youtube.com/watch?v=lmiRYar996w&t=1147s , but problem is that arkit is compatible with only iOS. Is there any similar way i can do this in arcore_flutter_plugin? Planning to put a bounty on this question.

I already know how to place nodes, so not looking forward to answers that ephasise too much on nodes, a simple answer that describes how to do that, perhaps with code will suffice

shaders – Updated Unity project from 2020.2.1f to 2021.1.7: lighting is messed up, scenes are brighter

I’ve updated my project from 2020.2.1f to 2021.1.7 (also tried 2020.3.8), and now my scenes are much brighter for some reason:
enter image description here

Any tips?

Current I use the standard pipeline I think, because the Render Pipeline Asset is set as None.

I have only one realtime directional light in the scene, and no Lighting Settings set in the Lighting window. The environment is the Default-Skybox.

java – Avoid code duplication across scenes in javafx?

I am writing a small GUI in javafx but have a navigation bar that’s on every scene I have of the application. I would like that the applications have a single file which I can just edit and somehow inject into the different scenes.
Is there a smart way to inject or import parts of a scene before it’s loaded – so that I can just import the navigation bar instead of writing it and adding changes to all the scenes?

This is my main file:

package view;

import javafx.application.Application;
import javafx.fxml.*;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import static javafx.application.Application.launch;


import javafx.application.Application;
import javafx.fxml.*;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import static javafx.application.Application.launch;


public class Init extends Application { 

 
    @Override 
    public void start(Stage primaryStage) throws Exception {
       
        try {
            
            FXMLLoader loader = new FXMLLoader();
            primaryStage.setTitle("Softwarehuset A/S | Project management");
            
            loader.setLocation(
                    Init.class.getResource(
                            "./ProjectView.fxml"
                    )
            );
            Parent root = loader.load();
       
            Scene scene = new Scene(root, 1280, 800);
           
            boolean resizable = primaryStage.isResizable();
            primaryStage.setResizable(!resizable);

            primaryStage.setScene(scene);
            primaryStage.show();
             
            
        } catch (Exception e){
            System.out.println(e);
        }
           
         
    }


    public static void main(String() args) {
        launch(args);
    }

    
    
}

The navigation bar to the left is inside a VBox and is currently written in all my pages. And can be seen here:
enter image description here

unity – RuntimeInitializeOnLoadMethod only on certain scenes

I’m using (RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)) to initialize a prefab that contains all the components required for the game to work propertly.

public class FrameworkInitializer : MonoBehaviour
{
    (RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad))
    public static void InitializeFramework()
    {
       Instantiate(Resources.Load("_GameEngine")) as GameObject;
    }
}

It works fine.

Now I’m creating some scenes to try out things before implementing them in the final game, and I don’t really need the default prefab to initialize. I tried adapting the script to this:

public class FrameworkInitializer : MonoBehaviour
{
    (RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad))
    public static void InitializeFramework()
    {
        if (GameObject.FindWithTag("Framework Support") != null) return;
        if (GameObject.Find("NoFrameworkSupportRequired") != null)
        {
            Debug.LogWarning("Carla Framework initializer skipped because of NoFrameworkSupportRequired gameobject in scene.");
            return;
        }
        var framework = Instantiate(Resources.Load("_GameEngine")) as GameObject;
    }
}

But it’s not working, because the scene is not loaded yet so it can’t find any gameobject.

And if I change BeforeSceneLoad to AfterSceneLoad, some of the scripts that require the prefab in the start cycle fails.

How can I make this script to run only on some of the scenes?

unity – Is it okay to use different player scripts for some scenes?

I’m making a game with Unity. I wanted the player script to not have some features in some scenes but couldn’t remove them from the script because I needed them for other scenes, so I just unpacked those player prefabs, created new scripts for each of them and removed the lines that I didn’t want to have. I know this was not the best idea but I don’t know any other way. One of its problems is that it makes managing the scripts hard and confusing. My question is that is it okay that I did this from game performance perspective for example? Is there a way that I can change them without creating new ones? Since I’m going to switch to the new Input system, I want to avoid the possible problems and headaches around these scripts. I also did this (creating a new script) for pause menu script as well. I provided two examples below to make the situation more clear.

Example A) The player can use a shotgun in one of the scenes and I chose to not let him to use the knife in there. So I created a new script for that player and copied and pasted the original script (which had the melee attack ability) and then removed those lines from the new script.

Example B) Pause menu can disable the health bar game object whenever the escape button is pressed. But for one of the levels, I don’t want to use the health bar, so I pasted the code in a new pause menu script and removed the line that disables the bar.

Thanks in advance.

textures – How to give a certain scene different preference settings then other scenes unity

In my unity game that I am creating there are 4 scenes. 3 of those scenes rely on a backdrop because they are the main menu, death screen and the escape screen(for when you escape the place). Therefore they need a high resolution image. However, the other scene (the main game scene) is incredibly laggy when the quality setting for the texture quality isn’t “eighth res”. How can I make it so that the texture quality for only my game scene is eighth res and the rest is normal res? This might help: my build order value is the main menu is 0, my game is 1, my death scene is 2 and my escape scene is 3.
thanks in advance

How are website passwords cracked? Any password hacking scenes from Mr Robot or other films?

What approaches are there for cracking user passwords for website/e-mail accounts? can only think of three strategies, but what else?

  • Algorithmically: Combinatorially attempting different sequences of alpha-numeric-special characters
  • Internally: Client database information is leaked, but actually, companies rarely store passwords for any to be leaked
  • Heuristically: Phishing information from the victim beforehand to somehow infer their password, or confidence trick them to enter it on a dummy website
  • Virally: Using a key-logger or other backdoor method that captures user’s password as it is being entered or viewed on-screen

For motivating ideas to add to the above list, does the hacker in the show Mr Robot, Elliot, ever demonstrate some sort of ability to break into peoples’ or organizations’ log-in by cracking their passwords? If so which seasons and episodes does he do this? or what other movies or shows depicts this?

unity – Mirror Networking; Scene’s network objects are disabled when building server separately

if one of the clients is also the server then this situation does not happen and networked scene objects are visible. But when building the server separately and then when a client is connected, all the network objects are disabled. I have read the documentation but still can’t figure it out. I am loading the level scene additively. Here is the related documantation and link :
https://mirror-networking.com/docs/Articles/Components/NetworkIdentity.html
https://mirror-networking.com/docs/Articles/Guides/Visibility.html

Scene-based Network Game Objects

You can also network game objects that are saved as part of your Scene (for example, environmental props). Networking game objects makes them behave slightly differently, because you need to have them spawn across the network.
When building your game, Unity disables all Scene-based game objects with Network Identity components. When a client connects to the server, the server sends spawn messages to tell the client which Scene game objects to enable and what their most up-to-date state information is. This ensures the client’s game does not contain game objects at incorrect locations when they start playing, or that Unity does not spawn and immediately destroy game objects on connection (for example, if an event removed the game object before that client connected). See Networked Scene Game Objects for more information.

Network Visibility

Multiplayer games use the concept of network visibility to determine which players can see which game objects at any given time during game play. In a game that has a moving viewpoint and moving game objects, it’s common that players cannot see everything that is happening in the game at once.
If a particular player, at a certain point in time during game play, cannot see most of the other players, non-player characters, or other moving or interactive things in your game, there is usually no need for the server to send information about those things to the player’s client.
This can benefit your game in two ways:

  1. It reduces the amount of data sent across the network between
    players. This can help improve the responsiveness of your game, and
    reduce bandwidth use. The bigger and more complex your multiplayer
    game, the more important this issue is.
  2. It also helps prevent some cheating. Since a player client does not
    have information about things that can’t be seen, a hack on that
    player’s computer cannot reveal the information.

The idea of “visibility” in the context of networking doesn’t necessarily relate to whether game objects are directly visible on-screen. Instead, it relates to whether data should or shouldn’t be sent about the game object in question to a particular client. Put simply, if a client can’t ‘see’ an game object, it does not need to be sent information about that game object across the network. Ideally you want to limit the amount of data you are sending across the network to only what is necessary, because sending large amounts of unnecessary data across the network can cause network performance problems.
However, it can be also be resource intensive or complex to determine accurately whether a game object truly visible to a given player, so it’s often a good idea to use a more simple calculation for the purposes of determining whether a player should be sent networked data about it – i.e. whether it is ‘Network Visible’. The balance you want to achieve when considering this is between the cost of the complexity of the calculation for determining the visibility, and the cost of sending more information than necessary over the network. A very simple way to calculate this is a distance (proximity) check, and Mirror provides a built-in component for this purpose.

unity – Mirror network. How to change player objects when switching scenes?

I have a scene for lobby. When player connects to server he gets a lobbyCharacter, which is an empty gameobject with a script on it that create UI element with the players name. In lobby players can select character they want to use.

Now when starting game, i would like to switch scene to the game scene when all players are ready. I have been reading the API, documentation, and different stack questions, but i cant seem to find any info on how this should work. On NetworkManager i can do scene schange which will be changed on all clients. But how do i persist data over multiple scenes? And if the lobby characters are destroyied how are the game characters instansiated according to the choises made in lobby? How does the client connection persist between multiple scenes?

Do i just manage the character locally and use syncHooks to synchronize over the server? Do i need to create somesort of container gameobject that holds the player connection information and some extra stuff?