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

102
Views
Instantiated object appears in hierarchy but not on scene

I have a problem with instantiating game object in Unity. So the game is 2D, and this piece of code is for my collider hit. Part of it is in charge of instantiating an object at position where the ray has hit the collider. And it does, when i run the game and ray hits the collider, instatiated object appears in hierarchy but not visible on scene and in debug, value of tmpCircle is null, here is the code:

if (result.collider.CompareTag("Images"))
                {                    
                    Debug.Log("Hit");
                    result.collider.enabled = false;                    
                    GameObject tmpCircle = GameObject.Instantiate(OrgCircle, result.point, Quaternion.identity);
                    tmpCircle.SetActive(true);   
                    tmpCircle.transform.position = new Vector3(result.point.x, result.point.y, result.point.z);
                    CircleAnimation.Play("CircleAnim");
                    score += 1;
                    differences -= 1;
                    coins += 1;
                    score1.text = " " + score;
                    object.Play();
                }

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Perhaps since its 2D, the sprite component is drawing behind other sprites. Try increasing the z index. Or the sprite renderer component is not enabled in your prefab. Check the scale of the sprite.

over 4 years ago · Santiago Trujillo Report
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!