Hello, i have a problem with LoadLevelAdditiveAsync I am currently developing a mmo however I encounter some problems with the use of LoadLevelAdditiveAsync currently I have 2 scenes login and world with a server made in nodeJS when the successful connection happens well on the world scene however login remains present (I inquired and I read that it was necessary to use destroy to remove the prefab not to use is it always the case?)
I also have a problem to display the user’s name on the ui i use this way
private Text users;
users = GameObject.Find("player").GetComponent<Text>();
users.text = logininput.text;
It sounds like you should be using Application.LoadLevelAsync to replace login with world, instead of LoadLevelAdditiveAsync which will add login and world together. (Or, if you’re using a newer version of Unity, use SceneManager.LoadScene).
For the player name problem, you’ll probably want to keep your login info in a data structure that exists outside of the login scene so you can access it in the world scene. Something like:
public static class LoginInfo {
public static string playerName;
}
Then, assuming your player GameObject is always named “player” and it always has a UI Text component, you can do this:
users.text = LoginInfo.playerName
(This really isn’t the most robust or ideal way to handle it, but it’s a start.)