Flauros 6 Report post Posted July 4, 2020 ¿Hay que poner algún script para que al cambiar de escena la vida del personaje se mantenga como en la escena anterior? Un saludo! Share this post Link to post Share on other sites
Igor 337 Report post Posted July 4, 2020 se puede hacer de muchas maneras puedes hacer una clase estatica public static class globalVariables { public static float playerLife = 100; } //luego puedes acceder a esa variable desde cualquier script //con: globalVariables.playerLife = 87;//porejemplo //esas variables de esa clase se mantendran entre escenas tambien puedes usar PlayerPrefs para guardar y cargar datos.... tambien puedes usar "dontDestroyOnLoad" para hacer que un GameObject se mantenga entre escenas 1 Share this post Link to post Share on other sites
Flauros 6 Report post Posted July 4, 2020 Este script iría en el player? (Soy un poco noob perdona) Share this post Link to post Share on other sites
nomoregames 35 Report post Posted July 4, 2020 (edited) Anda, no lo había visto Edited July 4, 2020 by nomoregames Share this post Link to post Share on other sites
Igor 337 Report post Posted July 4, 2020 el script "public static class globalVariables" no es "monoBehaviour".... no va en ningun gameObject.... no hay que añadirlo en ningun lado Share this post Link to post Share on other sites
Flauros 6 Report post Posted July 4, 2020 Intentaré hacerlo muchas gracias Share this post Link to post Share on other sites