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();
}