Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
¿Por qué el gameobject en la jerarquía no puede encontrarlo sin problemas? Resuelto

Quiero encontrar el GameObject que está en la jerarquía correctamente en la jerarquía. Pero esto no sucede correctamente, así que quiero que 'si' funcione cuando el objeto de juego que he etiquetado esté activo, pero 'si' funciona aunque no haya otra etiqueta de objeto de juego, por lo que se produce este problema.

Nota: Mi nivel de inglés no es bueno, trato de explicarte el problema lo más que puedo, por favor dime si hay algo que no entiendes, trataré de explicarlo en detalle lo más que pueda. Gracias por su comprensión.

  1. Imagen etiquetada gameobject: ingrese la descripción de la imagen aquí
  2. El punto donde ocurrió el problema: ingrese la descripción de la imagen aquí
  3. Nombre de la etiqueta de Gameobject: ingrese la descripción de la imagen aquí
  4. Cubes Gameobject: ingrese la descripción de la imagen aquí
 void Update() { if (cubes.instance.objPool.Count == 1) //It works when the number of gameobject in the list is 1 when I do a random deletion. { RewardSystem(); } } public void RewardSystem() { GameObject FoundCube = GameObject.FindGameObjectWithTag(cube_Tag_Number); if (FoundCube == null) { SoundManager.instance.GameOverMenuSound(); game_Over_Menu.SetActive(true); next_Level_Menu.SetActive(false); confetti.Stop(); clickButton.gameObject.SetActive(false); missionButton.gameObject.SetActive(false); enabled = false; } if (FoundCube != null)// problematic if { if (FoundCube.activeInHierarchy == true) // problematic if { SoundManager.instance.NextLevelMenuSound(); next_Level_Menu.SetActive(true); confetti.Play(); game_Over_Menu.SetActive(false); clickButton.gameObject.SetActive(false); missionButton.gameObject.SetActive(false); enabled = false; } } } public class cubes : MonoBehaviour { public static cubes instance; public int randomRangeNumber1, randomRangeNumber2; public List<GameObject> objPool = new List<GameObject>(); private void Awake() { if (instance == null) { instance = this; } else if (instance != null) { Destroy(gameObject); } } public void ButtonOnDown() { SoundManager.instance.LuckButtonSound(); for (int i = 0; i < 1; i++) { int index = Random.Range(randomRangeNumber1, randomRangeNumber2); GameObject.Destroy(objPool[index]); objPool.RemoveAt(index); randomRangeNumber2 = objPool.Count; } } }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!